想问是只写了3.jsp这个页面了,后面的pass=11就不明白了,并没有写这个页面,所以想请大家给一下这方面的资料参考一下谢谢
2.jsp
<html>
<form method=post action="3.jsp?pass=11"> //就是这个不明白,提交的时候为什么到3.jsp与
//3.jsp?pass=11是一样的界面呢?哪里这方面的资料给一下呢,请不要说在BAIDU里自己搜,谢谢
<%
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>
2.jsp
<html>
<form method=post action="3.jsp?pass=11"> //就是这个不明白,提交的时候为什么到3.jsp与
//3.jsp?pass=11是一样的界面呢?哪里这方面的资料给一下呢,请不要说在BAIDU里自己搜,谢谢
<%
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>
如果有一个javabean是连接数据库的,<jsp:useBea/>中怎么才能设置scope的范围呢,就是说怎么才能知道要设置为scope=page,request,application
如果在一次请求中使用,用request
如果在一次会话中使用,session
如果整个应用中使用,application,周期为第一次调用到关闭服务器
3.jsp中用request.getParameter("pass")接