Re: s2 : assigning a variable to jsp
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: > > > > 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_"+; > > > 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: > >> > >> >> type="java.lang.String" /> > >> > >> Now I can access the variable via: <%=assign%> > >> > >> How can i accomplish this in struts2 for a property: > >> > >> > >> > >> 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]
Re: s2 : assigning a variable to jsp
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: 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_"+; 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: Now I can access the variable via: <%=assign%> How can i accomplish this in struts2 for a property: thanks in advance. Niels - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: s2 : assigning a variable to jsp
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: > >type="java.lang.String" /> > > Now I can access the variable via: <%=assign%> > > How can i accomplish this in struts2 for a property: > > > > thanks > in advance. > > Niels - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: s2 : assigning a variable to jsp
Hm, want the otherway around. something like: <%= technologyName %> On Mar 21, 2008, at 12:11 PM, Deepak Kumar wrote: Hi, In Struts 2 you can use http://www.roseindia.net/struts/struts2/struts2controltags/set-tag.shtml Thanks -Original Message- From: niels [mailto:[EMAIL PROTECTED] Sent: Friday, March 21, 2008 4:35 PM To: user@struts.apache.org Subject: s2 : assigning a variable to jsp Hello, I want to assign a property to a value in jsp. in struts 1.3 i could do it like: Now I can access the variable via: <%=assign%> How can i accomplish this in struts2 for a property: thanks in advance. Niels - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: s2 : assigning a variable to jsp
Hi, In Struts 2 you can use http://www.roseindia.net/struts/struts2/struts2controltags/set-tag.shtml Thanks -Original Message- From: niels [mailto:[EMAIL PROTECTED] Sent: Friday, March 21, 2008 4:35 PM To: user@struts.apache.org Subject: s2 : assigning a variable to jsp Hello, I want to assign a property to a value in jsp. in struts 1.3 i could do it like: Now I can access the variable via: <%=assign%> How can i accomplish this in struts2 for a property: thanks in advance. Niels - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
s2 : assigning a variable to jsp
Hello, I want to assign a property to a value in jsp. in struts 1.3 i could do it like: Now I can access the variable via: <%=assign%> How can i accomplish this in struts2 for a property: thanks in advance. Niels