In my example i only needed one parameter, so i was able to simply
append my dynamic value to the url, knowing that the single parameter
causes the url to end with "?param=", so my appended value is at the
correct location. I know that multiple <s:param> occurrences are
possible and cause appropriate ?param1=123¶m2=abc syntax, but i was
wondering how i would then supply the values for each of the parameters
dynamically, i.e. dynamic values at the locations of "123" and "abc" in
the example.
Thanks for mentioning ognl, maybe i need to have a closer look in this
direction. Sorry if this has been asked before, but how would i access
the value of a JSP-local variable in an ognl expression? With this, i
would easily be able to achieve what i want. Do i have to put the
variable value into one of the scopes that ognl is capable to access by
default? That would be a bit ugly, but doable unless i need a complex
iteration on my JSP, each of which would append one occurrence of <s:param>.
Further thoughts? Documentation pointers?
Robert
Nils-Helge Garli Hegvik wrote:
I'm not quite sure if I understand your example, but there should be
no problem having multiple <s:params> inside the url tag. I think
rtexprvalue was disabled due to some security issues with the
combination of ognl and rtexprval. However, you should be able to use
ognl expressions instead.
Nils-H
On Wed, Dec 17, 2008 at 11:59 AM, Robert Graf-Waczenski <r...@lsoft.com> wrote:
Hi,
i'm using <s:param> inside an <s:url> tag to dynamically generate the
appropriate url params. In my current example i only need one parameter, so
in order to add the parameter value dynamically to the url, i can do so
here:
<s:url><s:param name=myParam/></s:url><%=whateverObject.getBlurb()%>
So i have a situation were i can do what i currently need, but once i need
more than one parameter with dynamic values for each of them, i already see
that i'm running into a problem.
I think that the culprit is that the value= attribute of the <s:param> tag
is defined with rtexprvalue=false (in the tld), so trying to use a dynamic
value directly inside the <s:param> tag of course yields a runtime error.
What is the reasoning behind restricting the value= attribute to non-runtime
values only?
How would one create a url with multiple url parameters? I know how to do
this by hand using plain old Java code, i'd like to know what S2 has to
offer in this regard.
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