You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Jim Kiley <jh...@summa-tech.com> on 2008/06/11 21:01:26 UTC

Confused about s:include

Hey gang,

*Struts 2 In Action* suggests that I can use the name of an action in the
'value' attribute of the <s:include> tag.  However, when I try <s:include
value="myAction"/> or <s:include value="myAction.action"/> or even
<s:include value="/namespace/myAction.action"/> I get bupkus (in fact, the
including page doesn't even render).  The tag works fine if I feed it a
JSP's name instead of an action name.

Can anyone point me in the right direction here?

-- 
Jim Kiley
Technical Consultant | Summa
[p] 412.258.3346 [m] 412.445.1729
http://www.summa-tech.com

Re: Confused about s:include

Posted by Jeromy Evans <je...@blueskyminds.com.au>.
Jim Kiley wrote:
> I guess I could just use <s:action>, huh?  It's amazing how these insights
> reach me five minutes after I send mail to the list.
>
> jk
>   
>   
The Include tag creates a javax.servlet.RequestDispatcher and performs 
an include operation [1].  The tag attempts to create a reference to the 
resource provided as a parameter based on the current servlet path.  It 
should be able to invoke an action if the Struts2 Filter sees that 
include request. 

The Action tag creates a struts ActionInvocation based on your 
Configuration and invokes it as accessed via the Filter (through all the 
interceptors). It can invoke any action but be wary that the 
ActionContext is stored in a ThreadLocal (not saved and restored after 
an invocation) and not all results can be safely executed within another 
page.

Hope that helps,
Jeromy Evans

[1]http://java.sun.com/products/servlet/2.3/javadoc/javax/servlet/RequestDispatcher.html#include(javax.servlet.ServletRequest,%20javax.servlet.ServletResponse)


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


Re: Confused about s:include

Posted by Jim Kiley <jh...@summa-tech.com>.
I guess I could just use <s:action>, huh?  It's amazing how these insights
reach me five minutes after I send mail to the list.

jk

On Wed, Jun 11, 2008 at 3:01 PM, Jim Kiley <jh...@summa-tech.com> wrote:

> Hey gang,
>
> *Struts 2 In Action* suggests that I can use the name of an action in the
> 'value' attribute of the <s:include> tag.  However, when I try <s:include
> value="myAction"/> or <s:include value="myAction.action"/> or even
> <s:include value="/namespace/myAction.action"/> I get bupkus (in fact, the
> including page doesn't even render).  The tag works fine if I feed it a
> JSP's name instead of an action name.
>
> Can anyone point me in the right direction here?
>
> --
> Jim Kiley
> Technical Consultant | Summa
> [p] 412.258.3346 [m] 412.445.1729
> http://www.summa-tech.com




-- 
Jim Kiley
Technical Consultant | Summa
[p] 412.258.3346 [m] 412.445.1729
http://www.summa-tech.com