- 论坛徽章:
- 0
|
login.jsp是一个登录页面,如果帐号密码正确就转至A.jsp页面,当然为了防止直接进入A页面,所以采用session解决.
正常从login.jsp登录,一切正常!
但是直接进入A.jsp页面,却出现异常!
以下是A.jsp的一段代码:
if(session.isNew())
{ //如果是直接进入该页面就连接到登录页面:
response.sendRedirect("login.jsp");
}
else
{ ......
异常信息:
exception
org.apache.jasper.JasperException: Exception in JSP: /school/tianjia2.jsp:13
10:
11: if(session.isNew())
12: {//如果直接进入该页面就再连接到登录页面:
13: response.sendRedirect("temp.jsp");
14: }
15: else
16: { account=(String) session.getValue("account");
Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:504)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:387)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
root cause
java.lang.IllegalStateException
org.apache.catalina.connector.ResponseFacade.sendRedirect(ResponseFacade.java:432)
org.apache.jsp.school.tianjia2_jsp._jspService(org.apache.jsp.school.tianjia2_jsp:90)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802) |
|