Server-side equivalent of s:action 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-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Server-side equivalent of s:action tag?
If I understand your problem correctly, you might solve your problem by adding a dispatcherFORWARD/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 r...@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-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Server-side equivalent of s:action tag?
Nils-Helge Garli Hegvik wrote: If I understand your problem correctly, you might solve your problem by adding a dispatcherFORWARD/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 r...@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-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org