You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Chris Pat <cp...@yahoo.com> on 2005/10/05 16:52:44 UTC

action -> servlet

Hello
Is/how possible to forward from an Action to a servlet
even indirectly?  I try with a global forwards and
cant get the path right.  

This is to get around the design that I have the
Action create the file and I just want to serve the
file to a browser.  My servelet does it with
ServletStream and directly writing the html headers. 
The simplest is to just have the Action give it the
file name.  If I cant do it from an Action can I do
this with an Action?  Do I make the return be to a jsp
that/how serves the file?  Thank you.


		
__________________________________ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com

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


Re: action -> servlet

Posted by Dave Newton <ne...@pingsite.com>.
Martin Gainty wrote:

> The documentation for the Action Class
> http://struts.apache.org/api/org/apache/struts/action/Action.html
> shows that we can use
> ActionObject.setServlet(ActionServletObjectToAttach)

I'd think that forwarding would be a lot easier...

What kind of problems are you having with the path? If you posted code 
earlier, sorry, I missed it.

> Curious as to why you want to veer off from originating Servlet to 
> another Servlet?
> ----- Original Message ----- From: "Chris Pat" <cp...@yahoo.com>
>
>> This is to get around the design that I have the
>> Action create the file and I just want to serve the
>> file to a browser.  My servelet does it with
>> ServletStream and directly writing the html headers.
>
Probably because of that ;)

Dave



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


Re: action -> servlet

Posted by Martin Gainty <mg...@hotmail.com>.
Chris-
The documentation for the Action Class
http://struts.apache.org/api/org/apache/struts/action/Action.html
shows that we can use
ActionObject.setServlet(ActionServletObjectToAttach)
Curious as to why you want to veer off from originating Servlet to another 
Servlet?
Martin-

----- Original Message ----- 
From: "Chris Pat" <cp...@yahoo.com>
To: "Struts Users Mailing List" <us...@struts.apache.org>
Sent: Wednesday, October 05, 2005 10:52 AM
Subject: action -> servlet


> Hello
> Is/how possible to forward from an Action to a servlet
> even indirectly?  I try with a global forwards and
> cant get the path right.
>
> This is to get around the design that I have the
> Action create the file and I just want to serve the
> file to a browser.  My servelet does it with
> ServletStream and directly writing the html headers.
> The simplest is to just have the Action give it the
> file name.  If I cant do it from an Action can I do
> this with an Action?  Do I make the return be to a jsp
> that/how serves the file?  Thank you.
>
>
>
> __________________________________
> Yahoo! Mail - PC Magazine Editors' Choice 2005
> http://mail.yahoo.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
> 

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


Re: action -> servlet

Posted by Hubert Rabago <hr...@gmail.com>.
For the path, try using the same path that you would use if you were
calling the servlet directly from the browser, without the application
context.

You should also consider generating the file from the Action itself. 
The Action does have access to the servlet output stream and the html
headers.  If you go this route, you can generate the entire output
from your Action class and have it return null.

Hubert

On 10/5/05, Chris Pat <cp...@yahoo.com> wrote:
> Hello
> Is/how possible to forward from an Action to a servlet
> even indirectly?  I try with a global forwards and
> cant get the path right.
>
> This is to get around the design that I have the
> Action create the file and I just want to serve the
> file to a browser.  My servelet does it with
> ServletStream and directly writing the html headers.
> The simplest is to just have the Action give it the
> file name.  If I cant do it from an Action can I do
> this with an Action?  Do I make the return be to a jsp
> that/how serves the file?  Thank you.
>
>
>
> __________________________________
> Yahoo! Mail - PC Magazine Editors' Choice 2005
> http://mail.yahoo.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

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