You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Robert Graf-Waczenski <rg...@lsoft.com> on 2009/03/05 15:09:21 UTC

Server-side equivalent of tag?

Hi!

We need the ability to fetch the result of a Struts2 action on the 
server, so that the response text is available as a String. With a 
Struts1 action, we were able to utilize a RequestDispatcher for this 
task. Due to Struts2 being served by a filter and not by a servlet, this 
approach no longer works and gives HTTP 404. We had a brief look at the 
source code of the ActionTag class (i.e. the one behind the <s:action> 
tag) of the Struts2 view layer, but the code that actually fetches the 
response and writes it to the client is too deeply buried, so maybe some 
kind soul can give us a pointer on how to accomplish this with Struts2.

Any help and further pointers are appreciated.

Thanks in advance,

Robert

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


Re: Server-side equivalent of tag?

Posted by Robert Graf-Waczenski <rg...@lsoft.com>.
Nils-Helge Garli Hegvik wrote:
> If I understand your problem correctly, you might solve your problem
> by adding a <dispatcher>FORWARD</dispatcher> element to the Struts 2
> filter mapping. That will make sure that the Struts 2 filter also will
> handle requests forwarded with a RequestDispatcher.
>
> Nils-H
>
> On Thu, Mar 5, 2009 at 3:09 PM, Robert Graf-Waczenski <rg...@lsoft.com> wrote:
>   
>> Hi!
>>
>> We need the ability to fetch the result of a Struts2 action on the server,
>> so that the response text is available as a String. With a Struts1 action,
>> we were able to utilize a RequestDispatcher for this task. Due to Struts2
>> being served by a filter and not by a servlet, this approach no longer works
>> and gives HTTP 404. We had a brief look at the source code of the ActionTag
>> class (i.e. the one behind the <s:action> tag) of the Struts2 view layer,
>> but the code that actually fetches the response and writes it to the client
>> is too deeply buried, so maybe some kind soul can give us a pointer on how
>> to accomplish this with Struts2.
>>
>> Any help and further pointers are appreciated.
>>
>> Thanks in advance,
>>
>> Robert
>>     


You ROCK! That did the trick. Thanks a lot!

Robert

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


Re: Server-side equivalent of tag?

Posted by Nils-Helge Garli Hegvik <ni...@gmail.com>.
If I understand your problem correctly, you might solve your problem
by adding a <dispatcher>FORWARD</dispatcher> element to the Struts 2
filter mapping. That will make sure that the Struts 2 filter also will
handle requests forwarded with a RequestDispatcher.

Nils-H

On Thu, Mar 5, 2009 at 3:09 PM, Robert Graf-Waczenski <rg...@lsoft.com> wrote:
> Hi!
>
> We need the ability to fetch the result of a Struts2 action on the server,
> so that the response text is available as a String. With a Struts1 action,
> we were able to utilize a RequestDispatcher for this task. Due to Struts2
> being served by a filter and not by a servlet, this approach no longer works
> and gives HTTP 404. We had a brief look at the source code of the ActionTag
> class (i.e. the one behind the <s:action> tag) of the Struts2 view layer,
> but the code that actually fetches the response and writes it to the client
> is too deeply buried, so maybe some kind soul can give us a pointer on how
> to accomplish this with Struts2.
>
> Any help and further pointers are appreciated.
>
> Thanks in advance,
>
> Robert
>
> ---------------------------------------------------------------------
> 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