JSP页面间传递参数方法介绍(2)
来源:未知 责任编辑:责任编辑 发表时间:2014-01-20 07:53 点击:次
< 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>
相关新闻>>
- 发表评论
-
- 最新评论 更多>>