You should use the velocity result, rather than the dispatcher. That way it can set up the macros for you (and not have to go through a RequestDispatcher)
> -----Original Message----- > From: Hans Prueller [mailto:[EMAIL PROTECTED] > Sent: Tuesday, December 09, 2003 12:39 PM > To: [EMAIL PROTECTED] > Subject: [OS-webwork] WW2: exception when calling #parse() in > a velo-template > > > Hello! > > In my first WW2 application, I have the following action: > > <action name="ojlist" class="test.action.ObjListAction"> > <result name="input" type="dispatcher"> > <param name="location">/vm/rep/objlist.vm</param> > </result> > <interceptor-ref name="defaultStack"/> > </action> > > When I try to parse an additional template within the resulting > objlist.vm I get the following exception (see below). > Is it not allowed to use #parse in templates or is the > exception due to > a WW2 bug? > > kind regards, > hans prueller > > > java.lang.IllegalStateException: getWriter() has already been called > > for this response at > > > org.apache.coyote.tomcat4.CoyoteResponse.getOutputStream(Coyot > eResponse.java:586) > > at > > > org.apache.coyote.tomcat4.CoyoteResponseFacade.getOutputStream > (CoyoteResponseFacade.java:158) > > at > > > org.apache.velocity.servlet.VelocityServlet.error(VelocityServ > let.java:613) > > at > > > org.apache.velocity.servlet.VelocityServlet.doRequest(Velocity > Servlet.java:361) > > at > > > org.apache.velocity.servlet.VelocityServlet.doGet(VelocityServ > let.java:292) > > at javax.servlet.http.HttpServlet.service(HttpServlet.java:740) at > > javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at > > > org.apache.catalina.core.ApplicationDispatcher.invoke(Applicat > ionDispatcher.java:684) > > at > > > org.apache.catalina.core.ApplicationDispatcher.doForward(Appli > cationDispatcher.java:432) > > at > > > org.apache.catalina.core.ApplicationDispatcher.access$000(Appl > icationDispatcher.java:116) > > at > > > org.apache.catalina.core.ApplicationDispatcher$PrivilegedForwa > rd.run(ApplicationDispatcher.java:131) > > at java.security.AccessController.doPrivileged(Native Method) at > > > org.apache.catalina.core.ApplicationDispatcher.forward(Applica > tionDispatcher.java:348) > > at > > > com.opensymphony.webwork.dispatcher.ServletDispatcherResult.do > Execute(ServletDispatcherResult.java:67) > > at > > > com.opensymphony.webwork.dispatcher.WebWorkResultSupport.execu > te(WebWorkResultSupport.java:53) > > at > > > com.opensymphony.xwork.DefaultActionInvocation.executeResult(D > efaultActionInvocation.java:269) > > at > > > com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultA > ctionInvocation.java:191) > > at > > > com.opensymphony.xwork.interceptor.AroundInterceptor.intercept > (AroundInterceptor.java:37) > > at > > > com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultA > ctionInvocation.java:169) > > at > > > com.opensymphony.xwork.interceptor.AroundInterceptor.intercept > (AroundInterceptor.java:37) > > at > > > com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultA > ctionInvocation.java:169) > > at > > > com.opensymphony.xwork.interceptor.AroundInterceptor.intercept > (AroundInterceptor.java:37) > > at > > > com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultA > ctionInvocation.java:169) > > at > > > com.opensymphony.xwork.interceptor.TimerInterceptor.intercept( > TimerInterceptor.java:66) > > at > > > com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultA > ctionInvocation.java:169) > > at > > > com.opensymphony.xwork.DefaultActionProxy.execute(DefaultActio > nProxy.java:116) > > at > > > com.opensymphony.webwork.dispatcher.ServletDispatcher.serviceA > ction(ServletDispatcher.java:181) > > at > > > com.opensymphony.webwork.dispatcher.ServletDispatcher.service( > ServletDispatcher.java:161) > > > > > > ------------------------------------------------------- > This SF.net email is sponsored by: SF.net Giveback Program. > Does SourceForge.net help you be more productive? Does it > help you create better code? SHARE THE LOVE, and help us help > YOU! Click Here: http://sourceforge.net/donate/ > _______________________________________________ > Opensymphony-webwork mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork > ------------------------------------------------------- This SF.net email is sponsored by: SF.net Giveback Program. Does SourceForge.net help you be more productive? Does it help you create better code? SHARE THE LOVE, and help us help YOU! Click Here: http://sourceforge.net/donate/ _______________________________________________ Opensymphony-webwork mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork