用debug调试有跳转,但是会报错。
maillogin.jsp:
<body>
<p>欢迎光临邮件系统</p>
<p>Session ID:<%=session.getId() %></p>
<%
String name = null;
String password = null;
if(!session.isNew()){
name =(String)session.getAttribute("username");
password =(String)session.getAttribute("password");
}else{
response.getWriter().print("新的会话");
name = "";
password = "";
}%>
<form action="mailcheck.jsp" method="POST">
姓名:<input type="text" name="username" value="<%=name %>"/><br>
密码:<input type="password" name="password" value="<%=password %>" /><br>
<input type="submit" value="登陆">
</form>
</body>
mailcheck.jsp
<body>
<p>Session ID:<%=session.getId() %></p>
<%
String name = null;
String password = null;
name = request.getParameter("username");
password = request.getParameter("password");
if(name != null){
session.setAttribute("username", name);
session.setAttribute("password", password);
}else
name = (String)session.getAttribute("username");
password = (String)session.getAttribute("password");
if(name == null & password == null ){
%>
<jsp:forward page="maillogin.jsp"/>
<%
}
%>
<p>当前用户:<%=name %></p>
<p>您的信箱中有0封邮件未读</p>
<a href="maillogin.jsp">登陆</a>
<a href="mailout.jsp">退出</a>
</body>
解决方案 »
- 在NIO中,如何同步接收线程池中返回的处理结果,同时做到不阻塞程序?
- 如何验证一个链接有没有效
- 请问用JAVA编程哪一个平台比较好呢?谢谢
- 为什么是NullPointerException啊?
- 请各位高手指点一下,不胜感激!!
- 怎么设置JTable单列的宽度?
- 入门级jdbc连接数据库问题,请给位帮帮我
- 使用java做application server这类东东有没有前(钱)途??
- 64位的Windows server 2008 安装64位的JKD时出错
- maven install 时报错
- BufferedInoutStreamAndBufferedOutputStream
- 新手请教个java计算公式问题
The source attachment does not contain the source for the file HttpJspBase.class