直接用URL类来实现。
Apache的HttpClient也可以完成

解决方案 »

  1.   

    做个页面,把request用隐藏的变量保存起来直接发送请求不行吗?
      

  2.   

    就是类似论坛那种输入一次,第二次 不用输入的吧,COOKIE
      

  3.   

    cookie而且浏览器中必须将cookie打开
      

  4.   

    存到request的attribus里就行了,或者做个自动提交用户名密码的页面也行啊
      

  5.   

    听得不是很懂,
    既然你知道用户名和密码了,就直接用
    <input type=hidden name="username" vlaue="小王">
    <input type=hidden name="password" vlaue="密码">
    传给下一页就可以了
    不知道是不是你想表达的意思
      

  6.   

    url?name=str&psw=***
    cookie
    session
      

  7.   

    基本就这个意思,自己再改改吧
    import java.io.*;
    import java.net.Socket;
    import java.util.Properties;/**
     * Created by IntelliJ IDEA. 
     * Author: HUBIN 
     * Date: 2005-3-15 
     * Time: 14:20:07
     */
    public class Login {
    static String txt = "POST http://www.xxx.com/index.aspx HTTP/1.0\n" +
            "Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-powerpoint, application/vnd.ms-excel, application/msword, */*\n" +
            "Referer: http://www.xxx.com/index.aspx\n" +
            "Accept-Language: zh-cn\n" +
            "Content-Type: application/x-www-form-urlencoded\n" +
            "Proxy-Connection: Keep-Alive\n" +
            "User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; MyIE2; Maxthon; .NET CLR 1.0.3705)\n" +
            "Host: kq\n" +
            "Content-Length: 31\n" +
            "Pragma: no-cache\n" +
            "Cookie: ASP.NET_SessionId=lek1euepbok3uoii4dcony45\n" +
            "\n" +
            "txtUserCd=AAAA&txtPassword=BBBB"; public static Properties ppt = new Properties(); private static final String filename = "setup.properties"; private static String server = "192.168.0.1";
    private static int port = 80; static {
    try {
    ppt.load(new FileInputStream(filename));
    server = ppt.getProperty("server");
    port = Integer.parseInt(ppt.getProperty("port"));
    } catch (Exception e) {
    e.printStackTrace();  //Todo
    }
    } public static void main(String[] args) {
    OutputStream outsend = null; try {
    Socket outSkt = new Socket(server, port);
    outsend = new BufferedOutputStream(outSkt.getOutputStream());
    System.out.println(txt);
    outsend.write(txt.getBytes());
    outsend.flush();
    } catch (IOException e) {
    e.printStackTrace();  //Todo
    } finally {
    try {
    outsend.close();
    } catch (IOException e) {
    e.printStackTrace();  //Todo
    }
    }
    }
    }
      

  8.   

    弄个yahoo的验证码看你老板还彪。
      

  9.   

    楼主的意思可能是要cookie+session实现,在会话跟踪中,如果浏览器没开cookie,那就需要使用其他技术,好像是URL回写,具体的查一下HttpServletResponse接口中encodeRedirectURL(String) & encodeURL(String) ;