js| Notes | Page 1. How do I pass parameters across multiple JSP pages? You need to use the built-in scope object session of the JSP. Using its two methods setattribute (), getattribute ()
2. The following example implements the function of passing the parameters of the first JSP page to the third page
3. The code is as follows: 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>