Ok, that's a bit different... I'm not sure that the S2 tags expose
things as scripting variables (please correct me if I'm wrong)...

I guess you could set the variable to the request scope (or expose it
as a property on your action), and since the FilterDispatcher wraps
the servlet request to look for request attributes on the value stack,
you should be able to look up the attribute in the request, using
regular JSP expressions or JSP EL. This of course assumes that you
don't access the JSP directly, but through an action (which you should
be doing anyway).

Nils-H

On Fri, Mar 21, 2008 at 8:54 PM, niels <[EMAIL PROTECTED]> wrote:
> Hi Nils,
>
>  If looks at the docs, but can't find an example where I can set a jsp
>  variable. I have this situation, I use oscache like:
>
>  <cache:cache key="<%=cacheKey%>" time="120">
>
>  Where I want to set the jsp string 'cacheKey' with a property from the
>  value stack..
>
>  like (what of course doesn't work):
>
>  String cacheKey = "pre_"+<s:property value="pageAlias" />;
>
>
>  Thanks
>  Niels
>
>
>
>  On Mar 21, 2008, at 12:59 PM, Nils-Helge Garli Hegvik wrote:
>
>  > Check out the set [1] and property [2] tags. It might also be useful
>  > to read about the tag syntax [3]
>  >
>  > [1] - http://struts.apache.org/2.x/docs/set.html
>  > [2] - http://struts.apache.org/2.x/docs/property.html
>  > [3] - http://struts.apache.org/2.x/docs/tag-syntax.html
>  >
>  > Nils-H
>  >
>  > On Fri, Mar 21, 2008 at 12:05 PM, niels <[EMAIL PROTECTED]> wrote:
>  >> Hello,
>  >>
>  >> I want to assign a property to a value in jsp.
>  >>
>  >> in struts 1.3 i could do it like:
>  >>
>  >> <bean:define id="assign" name="somename" property="userName"
>  >> type="java.lang.String" />
>  >>
>  >> Now I can access the variable via:  <%=assign%>
>  >>
>  >> How can i accomplish this in struts2 for a property:
>  >> <s:property value="userName"/>
>  >>
>  >>
>  >> thanks
>  >> in advance.
>  >>
>  >> Niels
>  >
>
>
> > ---------------------------------------------------------------------
>  > To unsubscribe, e-mail: [EMAIL PROTECTED]
>  > For additional commands, e-mail: [EMAIL PROTECTED]
>  >
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to