时间:2021-07-01 10:21:17 帮助过:4人阅读
Insert title here
package cn.dzr.server;import java.io.InputStream;import java.io.PrintWriter;import java.net.ServerSocket;import java.net.Socket;public class AptanaServer{ public static void main(String[] args) throws Exception { System.out.println("服务器启动中......"); ServerSocket ss = new ServerSocket(9090); Socket s = ss.accept(); System.out.println(s.getInetAddress().getHostAddress()); InputStream in = s.getInputStream(); byte[] buff = new byte[1024]; int len = in.read(buff); String inData = new String(buff,0,len); System.out.println(inData); PrintWriter out = new PrintWriter(s.getOutputStream(),true); out.println("注册成功"); s.close(); ss.close(); }
我想知道,服务器传出去的数据,是怎么到达网页的。代码里我没看到获取之类的。是浏览器的功能,还是HTML的功能。
或者.....
re:
http://bbs.csdn.net/topics/390533830
PrintWriter out = new PrintWriter(s.getOutputStream(),true); out.println("注册成功");
form下的action就是提交的位置,submit是提交