jsp源码:模拟登录系统
============================
1.log.html
============================
<form action="log.jsp" method="post">
用户名:<input type="text" name="name"><br>
密码:<input type="password" name="pwd"><br>
<input type="submit" value="登录"><br>
</form>
=============================
2.log.jsp
=============================
<%
String name=request.getParameter("name");
String pwd=request.getParameter("pwd");
if(name.equals("abc")||name.equals("efg")){
response.sendRedirect("success.jsp?name="+name);
}else{
response.sendRedirect("fail.html");
}
%>