1. 怎么在多个JSP页面之间进行参数传递?需要使用JSP的内置作用域对象session。利用它的两个方法setAttribute(),getAttribute()
2. 下面的这个实例实现了把第一个JSP页面的参数传递给第三个页面的功能
3. 代码如下:1.JSP
<HTML>
<form method=get action=2.JSP>
what's your name<input type=text name=username>
<input type=submit value=submit>
</form>
</HTML>
4. 2.JSP
<HTML>
<form method=post action="3.JSP?pass=11">
<%
String name=request.getParameter("username");
session.setAttribute("username",name);
%>
Your name is:<%=request.getParameter("username")%>
<br>what's your hobby<input type=text name=hobby>
<input type=submit value=submit>
</form>
</HTML>
5. 3.JSP
<HTML>
your name is:<%=session.getAttribute("username")%>
<br>
your hobby is:<%=request.getParameter("hobby")%>
<br>
your password is:<%=request.getParameter("pass")%>
<br>
</form>
</HTML>
2. 下面的这个实例实现了把第一个JSP页面的参数传递给第三个页面的功能
3. 代码如下:1.JSP
<HTML>
<form method=get action=2.JSP>
what's your name<input type=text name=username>
<input type=submit value=submit>
</form>
</HTML>
4. 2.JSP
<HTML>
<form method=post action="3.JSP?pass=11">
<%
String name=request.getParameter("username");
session.setAttribute("username",name);
%>
Your name is:<%=request.getParameter("username")%>
<br>what's your hobby<input type=text name=hobby>
<input type=submit value=submit>
</form>
</HTML>
5. 3.JSP
<HTML>
your name is:<%=session.getAttribute("username")%>
<br>
your hobby is:<%=request.getParameter("hobby")%>
<br>
your password is:<%=request.getParameter("pass")%>
<br>
</form>
</HTML>