可以调用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
然后得到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