如何在两个jsp文件之间传值
1个回答
展开全部
通过request
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>
2.jsp
<html>
< %
String name=request.getParameter("username");
session.setAttribute("username",name);
%>
</html>
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>
2.jsp
<html>
< %
String name=request.getParameter("username");
session.setAttribute("username",name);
%>
</html>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询