[ http://issues.apache.org/struts/browse/STR-2969?page=comments#action_38858 ] Paul Benedict commented on STR-2969: ------------------------------------
The issue can be solved by using the JSTL import tag. > In some case,use <jsp:include> tag can lead to Response was close,then > "java.io.IOException: Stream closed" occur > ------------------------------------------------------------------------------------------------------------------- > > Key: STR-2969 > URL: http://issues.apache.org/struts/browse/STR-2969 > Project: Struts 1 > Issue Type: Bug > Affects Versions: 1.3.5 > Environment: windows xp sp2;jdk1.5,tomcat5.0.28 > Reporter: wumin > Attachments: SUP-3797.zip > > > If I use <jsp:include> tag like this:<jsp:include > page="/test2.do?action=index"></jsp:include>, the action return a jsp,the > jsp only display some string.but execption occur: > Servlet.service() for servlet jsp threw exception > java.io.IOException: Stream closed > at > org.apache.jasper.runtime.JspWriterImpl.ensureOpen(JspWriterImpl.java:203) > at > org.apache.jasper.runtime.JspWriterImpl.clearBuffer(JspWriterImpl.java:159) > at org.apache.jsp._1_jsp._jspService(_1_jsp.java:69) > at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97) > at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) > at > org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332) > at > org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314) > at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264) > at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) > at > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252) > at > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) > at > org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368) > at > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202) > at > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) > at > org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672) > at > org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463) > at > org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398) > at > org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301) > at > org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1085) > at > org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:263) > at > org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:398) > at > org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequestProcessor.java:318) > at > org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:241) > at > org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196) > at > org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414) > at javax.servlet.http.HttpServlet.service(HttpServlet.java:689) > at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) > at > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252) > at > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) > at > org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368) > at > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202) > at > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) > at > org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) > at > org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178) > at > org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126) > at > org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) > at > org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107) > at > org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) > at > org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869) > at > org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664) > at > org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527) > at > org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80) > at > org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684) > at java.lang.Thread.run(Thread.java:595) > My code: > struts_config.xml: > <action-mappings> > <action path="/test" > type="org.wumin.learn.structs.test.action.TestAction" parameter="action"> > <forward name="index" path="/1.jsp" ></forward> > </action> > <action path="/test2" > type="org.wumin.learn.structs.test.action.TestActionTwo" parameter="action"> > <forward name="index" path="/2.jsp" ></forward> > </action> > </action-mappings> > the index jsp: > <form action="<%=request.getContextPath()%>/test.do"> > <input type="submit" name="Submit" value="submit"> > <input type="hidden" name="action" value="index"> > </form> > the 1 jsp: > <html> > <head> > <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> > <title>JSP Page</title> > </head> > <body> > <h1>JSP Page1111111111111111111</h1> > <jsp:include page="/test2.do?action=index"></jsp:include> > </body> > </html> > the 2 jsp : > <html> > <head> > <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> > <title>JSP Page</title> > </head> > <body> > <h1>JSP Page222222222222222222222222</h1> > </body> > </html> > the TestAction class: > public ActionForward index( > ActionMapping mapping, > ActionForm form, > HttpServletRequest request, > HttpServletResponse response) throws Exception { > ActionForward retValue; > > retValue = mapping.findForward("index"); > return retValue; > } > the TestActionTwo class: > public ActionForward index( > ActionMapping mapping, > ActionForm form, > HttpServletRequest request, > HttpServletResponse response) throws Exception { > ActionForward retValue; > > retValue = mapping.findForward("index"); > return retValue; > } -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/struts/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira
