Thank you for the response. Below is my config for the action. Please let me know what else I am missing. I am at a real loss. I would hate to have to create a JSP and place Java code in there to do the streaming or to stream directly in the action. I would really like to do it in keeping with the Strust2 framework.
<action name="ContractDetailsNote" class="actnContractDetail" method="streamNote"> <result name="success" type="stream"> <param name="inputName">noteStream</param> <param name="contentType">text/html</param> <param name="bufferSize">1024</param> </result> <result name="error">/jsps/catalog/DisplayError.jsp</result> </action> Here is the call in my JSP page: <s:action name="ContractDetailsNote" executeResult="true" > <s:param name="contractDetailId" value="contractDetailId"/> </s:action> -----Original Message----- From: news [mailto:[EMAIL PROTECTED] On Behalf Of Laurie Harper Sent: Wednesday, May 21, 2008 2:09 PM To: user@struts.apache.org Subject: Re: [S2] Advice on Handling CLOBs in Struts2 Since that's not a normal result of using a stream result, I have to assume you are doing something wrong. Without seeing the relevant code/configuration, though, we can't offer much help. L. Hoying, Ken wrote: > I have tried to accomplish this by creating an action with a stream > result type. > > I am then including calling the action from with in my JSP page using > the <s:action> tag. > > Unfortunately though, I am getting the following error: > > [2008-05-21 11:26:25,702] [http-0.0.0.0-8080-2] [ERROR] [] > [ts2.components.ActionComponent]: Could not execute action: > /catalog/ContractDetailsNote > java.lang.IllegalStateException: getWriter() has already been called > for this response > at > org.apache.catalina.connector.Response.getOutputStream(Response.java:5 > 73 > ) > at > org.apache.catalina.connector.ResponseFacade.getOutputStream(ResponseF > ac > ade.java:183) > at > org.apache.struts2.dispatcher.StreamResult.doExecute(StreamResult.java > :2 > 19) > at > org.apache.struts2.dispatcher.StrutsResultSupport.execute(StrutsResult > Su > pport.java:178) > at > com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultA > ct > ionInvocation.java:348) > at > com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionIn > vo > cation.java:253) > at > org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.ja > va > :50) > at > org.apache.struts2.components.ActionComponent.executeAction(ActionComp > on > ent.java:255) > at > org.apache.struts2.components.ActionComponent.end(ActionComponent.java > :1 > 55) > at > org.apache.struts2.views.jsp.ComponentTagSupport.doEndTag(ComponentTag > Su > pport.java:43) > at > org.apache.jsp.jsps.catalog.AjaxContractInfo_jsp._jspx_meth_s_005facti > on > _005f0(AjaxContractInfo_jsp.java:413) > at > org.apache.jsp.jsps.catalog.AjaxContractInfo_jsp._jspx_meth_s_005fiter > at > or_005f0(AjaxContractInfo_jsp.java:297) > at > org.apache.jsp.jsps.catalog.AjaxContractInfo_jsp._jspx_meth_s_005fsort > _0 > 05f0(AjaxContractInfo_jsp.java:247) > at > org.apache.jsp.jsps.catalog.AjaxContractInfo_jsp._jspx_meth_s_005felse > _0 > 05f0(AjaxContractInfo_jsp.java:200) > at > org.apache.jsp.jsps.catalog.AjaxContractInfo_jsp._jspService(AjaxContr > ac > tInfo_jsp.java:99) > at > org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) > at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) > at > org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper. > ja > va:373) > at > org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:336) > at > org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265) > at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) > at > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appli > ca > tionFilterChain.java:290) > at > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFi > lt > erChain.java:206) > at > org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispa > tc > her.java:654) > at > org.apache.catalina.core.ApplicationDispatcher.processRequest(Applicat > io > nDispatcher.java:445) > at > org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDi > sp > atcher.java:379) > at > org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDisp > at > cher.java:292) > at > org.apache.struts2.dispatcher.ServletDispatcherResult.doExecute(Servle > tD > ispatcherResult.java:139) > at > org.apache.struts2.dispatcher.StrutsResultSupport.execute(StrutsResult > Su > pport.java:178) > at > com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultA > ct > ionInvocation.java:348) > at > com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionIn > vo > cation.java:253) > at > com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doInter > ce > pt(DefaultWorkflowInterceptor.java:221) > at > com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept( > Me > thodFilterInterceptor.java:86) > at > com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultA > ct > ionInvocation.java:224) > at > com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultA > ct > ionInvocation.java:223) > at > com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTime > rS > tack.java:455) > at > com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionIn > vo > cation.java:221) > at > com.opensymphony.xwork2.interceptor.TimerInterceptor.invokeUnderTiming > (T > imerInterceptor.java:125) > at > com.opensymphony.xwork2.interceptor.TimerInterceptor.intercept(TimerIn > te > rceptor.java:112) > at > com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultA > ct > ionInvocation.java:224) > at > com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultA > ct > ionInvocation.java:223) > at > com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTime > rS > tack.java:455) > at > com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionIn > vo > cation.java:221) > at > com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(Va > li > dationInterceptor.java:150) > at > org.apache.struts2.interceptor.validation.AnnotationValidationIntercep > to > r.doIntercept(AnnotationValidationInterceptor.java:48) > at > com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept( > Me > thodFilterInterceptor.java:86) > at > com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultA > ct > ionInvocation.java:224) > at > com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultA > ct > ionInvocation.java:223) > at > com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTime > rS > tack.java:455) > at > com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionIn > vo > cation.java:221) > at > com.opensymphony.xwork2.interceptor.TimerInterceptor.invokeUnderTiming > (T > imerInterceptor.java:125) > at > com.opensymphony.xwork2.interceptor.TimerInterceptor.intercept(TimerIn > te > rceptor.java:112) > at > com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultA > ct > ionInvocation.java:224) > at > com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultA > ct > ionInvocation.java:223) > at > com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTime > rS > tack.java:455) > at > com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionIn > vo > cation.java:221) > at > com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.interce > pt > (ConversionErrorInterceptor.java:123) > at > com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultA > ct > ionInvocation.java:224) > at > com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultA > ct > ionInvocation.java:223) > at > com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTime > rS > tack.java:455) > at > com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionIn > vo > cation.java:221) > at > com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept( > Pa > rametersInterceptor.java:167) > at > com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept( > Me > thodFilterInterceptor.java:86) > at > com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultA > ct > ionInvocation.java:224) > at > com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultA > ct > ionInvocation.java:223) > at > com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTime > rS > tack.java:455) > at > com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionIn > vo > cation.java:221) > at > com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.interc > ep > t(StaticParametersInterceptor.java:105) > at > com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultA > ct > ionInvocation.java:224) > at > com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultA > ct > ionInvocation.java:223) > at > com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTime > rS > tack.java:455) > at > com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionIn > vo > cation.java:221) > at > org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxI > nt > erceptor.java:83) > at > com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultA > ct > ionInvocation.java:224) > at > com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultA > ct > ionInvocation.java:223) > at > com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTime > rS > tack.java:455) > at > com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionIn > vo > cation.java:221) > at > com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(Chai > ni > ngInterceptor.java:115) > at > com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultA > ct > ionInvocation.java:224) > at > com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultA > ct > ionInvocation.java:223) > at > com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTime > rS > tack.java:455) > at > com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionIn > vo > cation.java:221) > at > com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInte > rc > eptor.java:143) > at > com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultA > ct > ionInvocation.java:224) > at > com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultA > ct > ionInvocation.java:223) > at > com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTime > rS > tack.java:455) > at > com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionIn > vo > cation.java:221) > at > com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(Pre > pa > reInterceptor.java:121) > at > com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept( > Me > thodFilterInterceptor.java:86) > at > com.premierinc.sca.interceptor.ScaPrepareInterceptor.intercept(ScaPrep > ar > eInterceptor.java:42) > at > com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultA > ct > ionInvocation.java:224) > at > com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultA > ct > ionInvocation.java:223) > at > com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTime > rS > tack.java:455) > at > com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionIn > vo > cation.java:221) > at > org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(Serv > le > tConfigInterceptor.java:170) > at > com.premierinc.sca.interceptor.ServletConfigEnhancedInterceptor.interc > ep > t(ServletConfigEnhancedInterceptor.java:73) > at > com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultA > ct > ionInvocation.java:224) > at > com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultA > ct > ionInvocation.java:223) > at > com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTime > rS > tack.java:455) > at > com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionIn > vo > cation.java:221) > at > com.premierinc.sca.interceptor.UserInterceptor.intercept(UserIntercept > or > ..java:129) > at > com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultA > ct > ionInvocation.java:224) > at > com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultA > ct > ionInvocation.java:223) > at > com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTime > rS > tack.java:455) > at > com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionIn > vo > cation.java:221) > at > com.premierinc.sca.interceptor.HibernateSessionInterceptor$FilterChain > In > voker.doFilter(HibernateSessionInterceptor.java:145) > at > org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doF > il > terInternal(OpenSessionInViewFilter.java:198) > at > org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRe > qu > estFilter.java:75) > at > com.premierinc.sca.interceptor.HibernateSessionInterceptor.intercept(H > ib > ernateSessionInterceptor.java:75) > at > com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultA > ct > ionInvocation.java:224) > at > com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultA > ct > ionInvocation.java:223) > at > com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTime > rS > tack.java:455) > at > com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionIn > vo > cation.java:221) > at > com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.interc > ep > t(ExceptionMappingInterceptor.java:176) > at > com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultA > ct > ionInvocation.java:224) > at > com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultA > ct > ionInvocation.java:223) > at > com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTime > rS > tack.java:455) > at > com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionIn > vo > cation.java:221) > at > org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.ja > va > :50) > at > org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java > :5 > 04) > at > org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatch > er > ..java:419) > at > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appli > ca > tionFilterChain.java:235) > at > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFi > lt > erChain.java:206) > at > org.apache.struts2.dispatcher.ActionContextCleanUp.doFilter(ActionCont > ex > tCleanUp.java:99) > at > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appli > ca > tionFilterChain.java:235) > at > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFi > lt > erChain.java:206) > at > org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFil > te > r.java:96) > at > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appli > ca > tionFilterChain.java:235) > at > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFi > lt > erChain.java:206) > at > org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperVa > lv > e.java:230) > at > org.apache.catalina.core.StandardContextValve.invoke(StandardContextVa > lv > e.java:175) > at > org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(Security > As > sociationValve.java:179) > at > org.apache.catalina.authenticator.AuthenticatorBase.invoke(Authenticat > or > Base.java:432) > at > org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve > .j > ava:84) > at > org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.ja > va > :127) > at > org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.ja > va > :102) > at > org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedCo > nn > ectionValve.java:157) > at > org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve. > java:109) > at > org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java > :2 > 62) > at > org.apache.coyote.http11.Http11Processor.process(Http11Processor.java: > 84 > 4) > at > org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proces > s( > Http11Protocol.java:583) > at > org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446) > at java.lang.Thread.run(Thread.java:595) > > > -----Original Message----- > From: Hoying, Ken [mailto:[EMAIL PROTECTED] > Sent: Wednesday, May 21, 2008 9:42 AM > To: user@struts.apache.org > Subject: [S2] Advice on Handling CLOBs in Struts2 > > Generally when working with Struts2, we have been loading a domaon > object from the database in our action and then sending then > referencing the properties as needed from the JSP to generate our output. > > However, we now what could potentially be a large amount of data > stored in a CLOB. Using the method that we have been using to date, > we would have to place the entire CLOB in a string in the action and > then access it from the JSP. Obviously, we would like to avoid doing that. > > I was wondering if anyone else had come across this and how they had > managed to solve it. How do we stream the content of the CLOB? > > Thank you! > Ken --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]