You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Murphy, Todd" <tr...@hersheys.com> on 2003/01/28 23:50:29 UTC
Must an Action forward to another JSP or servlet?
I am trying to render output as a PDF from a byte array. I am able to do
this successfully using an OutputStream, but the Writer class used in a JSP
is unable to properly write a byte array. My question: Is it possible to
write my output from within my action using an OutputStream as I would in a
normal servlet, but not forward to a JSP? I get a config.xml error when I
don't include the Forward tag, but I was hoping there was a way to direct it
to forward "nowhere". My other alternative would be to forward to a
servlet, but I was hoping to not add a servlet outside of the Struts
framework.
Thank you,
Todd Murphy
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: Must an Action forward to another JSP or servlet?
Posted by "Craig R. McClanahan" <cr...@apache.org>.
On Tue, 28 Jan 2003, Murphy, Todd wrote:
> Date: Tue, 28 Jan 2003 17:50:29 -0500
> From: "Murphy, Todd" <tr...@hersheys.com>
> Reply-To: Struts Users Mailing List <st...@jakarta.apache.org>
> To: struts-user@jakarta.apache.org
> Subject: Must an Action forward to another JSP or servlet?
>
> I am trying to render output as a PDF from a byte array. I am able to do
> this successfully using an OutputStream, but the Writer class used in a JSP
> is unable to properly write a byte array. My question: Is it possible to
> write my output from within my action using an OutputStream as I would in a
> normal servlet, but not forward to a JSP? I get a config.xml error when I
> don't include the Forward tag, but I was hoping there was a way to direct it
> to forward "nowhere". My other alternative would be to forward to a
> servlet, but I was hoping to not add a servlet outside of the Struts
> framework.
>
Simply return null from your Action, which tells the controller that the
response has already been completed, and that there is nothing more to do.
You might also note that this is documented in the Javadocs for
Action.execute().
> Thank you,
> Todd Murphy
Craig
>
> --
> To unsubscribe, e-mail: <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org