struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <craig...@apache.org>
Subject Re: Must an Action forward to another JSP or servlet?
Date Wed, 29 Jan 2003 07:25:19 GMT


On Tue, 28 Jan 2003, Murphy, Todd wrote:

> Date: Tue, 28 Jan 2003 17:50:29 -0500
> From: "Murphy, Todd" <trmurphy@hersheys.com>
> Reply-To: Struts Users Mailing List <struts-user@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:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Mime
View raw message