exception
jsp中response.sendRedirect引发的异常之解决方法
星期三, 六月 17th, 2009 | JAVA-and-J2EE | 一条评论
前几天的一个异常让人头疼,从网上查找也不得其法,后自己一看,原来是filter引发的转向错误!
解决方法很简单:
只要把转向的注释掉,让它自己转向就可以了,其他的事情交给filter去处理就可以了,就是两面都处理引发次问题!
if(user==null){
//response.sendRedirect(request.getContextPath()+”/index.jsp”);
return;
}
异常信息如下:
Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:505)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:410)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
com.i5a6.filter.ToBuildFilter.doFilter(ToBuildFilter.java:27)
root cause
java.lang.IllegalStateException
org.apache.catalina.connector.ResponseFacade.sendRedirect(ResponseFacade.java:435)
org.apache.jsp.users.payment.star_005fplus_005fwarehouse_jsp._jspService(star_005fplus_005fwarehouse_jsp.java:70)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
com.i5a6.filter.ToBuildFilter.doFilter(ToBuildFilter.java:27)
Search
相关文章
热门文章
最新文章
文章分类
- ajax (10)
- algorithm-learn (3)
- Android (6)
- as (3)
- computer (85)
- Database (30)
- disucz (4)
- enterprise (1)
- erlang (2)
- flash (5)
- golang (3)
- html5 (18)
- ios (4)
- JAVA-and-J2EE (186)
- linux (143)
- mac (10)
- movie-music (11)
- pagemaker (36)
- php (50)
- spring-boot (2)
- Synology群晖 (2)
- Uncategorized (6)
- unity (1)
- webgame (15)
- wordpress (33)
- work-other (2)
- 低代码 (1)
- 体味生活 (40)
- 前端 (21)
- 大数据 (8)
- 游戏开发 (9)
- 爱上海 (19)
- 读书 (4)
- 软件 (3)