struts2 用type="chain" 的跳转出错sendError() forbidden after buffer has been committed.

struts2 下用<result name="success" type="chain">login</result> ,跳转到login的action,会出现下面错误,是在resin的服务器下


java.lang.IllegalStateException: sendError() forbidden after buffer has been committed.at com.caucho.server.http.HttpServletResponseImpl.sendError(HttpServletResponseImpl.java:625)at org.apache.struts2.dispatcher.Dispatcher.sendError(Dispatcher.java:839)at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:533)at org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:434)at com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:89)at org.apache.struts2.dispatcher.ActionContextCleanUp.doFilter(ActionContextCleanUp.java:102)at com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:89)at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)at com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:89)at com.caucho.server.webapp.WebAppListenerFilterChain.doFilter(WebAppListenerFilterChain.java:114)at com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:156)at com.caucho.server.webapp.AccessLogFilterChain.doFilter(AccessLogFilterChain.java:95)at com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:287)at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:802)at com.caucho.network.listen.TcpSocketLink.dispatchRequest(TcpSocketLink.java:731)at com.caucho.network.listen.TcpSocketLink.handleRequest(TcpSocketLink.java:693)at com.caucho.network.listen.TcpSocketLink.handleRequestsImpl(TcpSocketLink.java:677)at com.caucho.network.listen.TcpSocketLink.handleRequests(TcpSocketLink.java:623)at com.caucho.network.listen.AcceptTask.doTask(AcceptTask.java:107)at com.caucho.network.listen.ConnectionReadTask.runThread(ConnectionReadTask.java:98)at com.caucho.network.listen.ConnectionReadTask.run(ConnectionReadTask.java:81)at com.caucho.network.listen.AcceptTask.run(AcceptTask.java:65)at com.caucho.env.thread.ResinThread.runTasks(ResinThread.java:164)at com.caucho.env.thread.ResinThread.run(ResinThread.java:130)


解决:

使用<result name="success" type="redirect">login.action</result>就不会出现这样的问题。


你可能感兴趣的:(struts,服务器,buffer,action,login)