<%--
Created by IntelliJ IDEA.
User: OldAZ-PC
Date: 2020/9/3
Time: 16:30
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html><head><title>login</title><script>
window.onload=function(){
document.getElementById("img").onclick=function(){this.src ="/4_Cookie_Session_war_exploded/checkCodeServlet?date="+newDate().getTime();}}</script><style>div{color: red;}</style></head><body><formaction="loginServlet"method="post"><table><tr><td>用户名</td><td><inputtype="text"name="username"></td></tr><tr><td>密码</td><td><inputtype=passwordname="password"></td></tr><tr><td>验证码</td><td><inputtype="text"name="checkCode"></td></tr><tr><tdcolspan="2"><imgid="img"src="/4_Cookie_Session_war_exploded/checkCodeServlet"></td></tr><tr><tdcolspan="2"><inputtype="submit"value="登录"></td></tr></table></form><div><%=request.getAttribute("cc_error")==null?"":request.getAttribute("cc_error")%></div><div><%=request.getAttribute("login_error")==null?"":request.getAttribute("login_error")%></div></body></html>
登录成功页面
<%--
Created by IntelliJ IDEA.
User: OldAZ-PC
Date:2020/9/3
Time:19:05
To change this template use File | Settings | File Templates.--%><%@ page contentType="text/html;charset=UTF-8" language="java"%><html><head><title>Title</title></head><body><h1><%=request.getSession().getAttribute("user")%>,欢迎您!!</h1></body></html>