I do not think you will be able to access the param value passed to s:include 
within struts tag [clearly an obvious shortcoming]. Your best bet is using jsp 
expression language as the parameter is put in request scope.

I was not able to do it, despite trying a million different forms as well as 
suggestions by some folks in strust mailing list.


--- On Fri, 2/27/09, Nils-Helge Garli Hegvik <nil...@gmail.com> wrote:

> From: Nils-Helge Garli Hegvik <nil...@gmail.com>
> Subject: Re: [s2] accesing params from s:include tag
> To: "Struts Users Mailing List" <user@struts.apache.org>
> Received: Friday, February 27, 2009, 2:14 PM
> Haven't really tried, but I assume the parameter would
> be a String, so
> have you tried using 'eq' instead of '=='.
> 
> Nils-H
> 
> On Fri, Feb 27, 2009 at 3:06 PM, hernan gonzalez
> <hgonza...@gmail.com> wrote:
> > I'm struggling with s:include + s:param in struts
> 2.0.14
> >
> > The docs  for the include tag
> http://struts.apache.org/2.0.14/docs/include.html
> > states:
> >
> > "How To access parameters  Parameters are passed
> as request
> > parameters, so use the ${param.ParamName} notation to
> access  them. Do
> > not use the property tag to access parameters in
> included files.
> >
> > That's not very clear for me, (and for others,
> judging from old
> > messages in the list).
> > The parameters passed to an included jsp via struts2
> tags can't be
> > accesed using struts2 tags??
> > (it appears that the parameters are not added to the
> "parameters"
> > collection in the actionContext)
> >
> > This should be really simple, please, can't
> someone give an example ?
> >
> > Say I have a page.jsp that includes a "fragment
> jsp" file via the following:
> >
> > <s:include
> value="frag.jsp"><s:param
> name="opt">1</s:param></s:include>
> >
> > In the frag.jsp I want to do something as
> >
> > <s:if test="#parameters.opt == 1"> ...
> </s2:if>
> >
> > What would be the correct syntax?
> >
> > Hernán J. González
> >
> >
> ---------------------------------------------------------------------
> > 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


      __________________________________________________________________
Instant Messaging, free SMS, sharing photos and more... Try the new Yahoo! 
Canada Messenger at http://ca.beta.messenger.yahoo.com/


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

Reply via email to