把他放到session或request里
session.setAttribute("USER",user);
下个页面得到
user = session.getAttribute("USER");

解决方案 »

  1.   

    我认为楼主的意思是在这个页面new一个对象。想在下一个页面中使用,而不是在下一个页面得到它的值。我觉得这个是做不到的:只有利用usebean标签,把scope属性设置为session才可以。
      

  2.   

    可以调用Request的public void setAttribute(java.lang.String name,java.lang.Object o)方法放到request对象中!
    然后得到RequestDispatcher,跳到另一个URL!
    解释:
    setAttribute
    public void setAttribute(java.lang.String name,
                             java.lang.Object o)Stores an attribute in this request. Attributes are reset between requests. This method is most often used in conjunction with RequestDispatcher. 
    Attribute names should follow the same conventions as package names. Names beginning with java.*, javax.*, and com.sun.*, are reserved for use by Sun Microsystems.Parameters:
    name - a String specifying the name of the attribute
    o - the Object to be stored