<form action="http://123.235.2.217:20000">(自己机子的ip) <fieldset > <legend>注册区域</legend> <table border= "1" bordercolor="#00FF66" width="400" cellpadding="10" cellspacing="0" > <tr> <th colspan="2">注册信息</th> </tr> <tr> <td>用户名</td> <td><input type="text" name="user"/></td> </tr>
import java.io.IOException;import java.io.InputStream;import java.io.OutputStream;import java.io.OutputStreamWriter;import java.io.PrintWriter;import java.net.ServerSocket;import java.net.Socket;public class Client { public static void main(String[] args) throws IOException{ ServerSocket sever = new ServerSocket(20000); Socket socket = sever.accept(); InputStream in = socket.getInputStream(); byte[] buf = new byte[1024]; int len = in.read(buf); System.out.println(new String(buf, 0, len)); OutputStream out = socket.getOutputStream(); PrintWriter pw = new PrintWriter(out,true); pw.println("<font size = 7 color = green>注册成功</font>"); System.out.println("hello world"); sever.close(); socket.close(); }}
不知道java是怎么写action的,php在action中写的路径是程序的相对路径