标签:org use pos logs cte bsp 失败 port 技术
代码:
login.jsp
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<body>
<br/>
<center>
<form action="check.jsp" method="post">
<input type="text" name="userName"><br>
<input type="password" name="password"><br>
<input type="submit" value="提交">
<input type="reset" value="重置">
</form>
</center>
</body>
</html>
check.jsp
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<html>
<body>
<%
request.setCharacterEncoding("utf-8");
String str1 = request.getParameter("userName");
String str2 = request.getParameter("password");
if( str1.equals("aaa") && str2.equals("aaa") ){
%>
<jsp:forward page="success.jsp"></jsp:forward>
<%
}else{
%>
<jsp:forward page="fail.jsp"></jsp:forward>
<%} %>
</body>
</html>
success.jsp
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<body>
<center>
<% String str1 = request.getParameter("userName"); %>
<% String str2 = request.getParameter("password"); %>
<h3><%=str1 %>!!! </h3>
<h3><%=str2 %></h3>
<h1>you are welcome!</h1>
</center>
</body>
</html>
fail.jsp
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<body>
<center>
<h1>登陆失败</h1><br>
<h1> <a href="login.jsp">请重新登陆</a> </h1>
</center>
</body>
</html>
标签:org use pos logs cte bsp 失败 port 技术
原文地址:http://www.cnblogs.com/qq1206050421/p/7615762.html