JSP基本语法集锦
1.servlet跳转到相应jsp页面
代码
request.setAttribute("param_id", user.getUserID()); //传到参数
request.setAttribute("param_user",user.getUserName());
request.setAttribute("param_pwd",user.getPassword());
request.getRequestDispatcher("/mainPage.jsp").forward(request, response); //页面跳转
request.setAttribute("param_user",user.getUserName());
request.setAttribute("param_pwd",user.getPassword());
request.getRequestDispatcher("/mainPage.jsp").forward(request, response); //页面跳转
2.当文本框内容改变,并且将焦点移开,如鼠标点击其他位置,f( )会被执行
<form name="form1" method="post" action="regist.jsp">
<input type="text" name="cloze" onchange="f()" />
<input type="text" name="cloze" onchange="f()" />
</form>