Im setting my parameter in my jsp like so -
<s:url id="open" action="viewEvent">
<s:param name="eventName" value="eventName" />
</s:url> <sj:a href="%{open}" targets="eventSearchResultsDiv">Open</sj:a>
How can I access this parameter in my jsp page. This does'nt seem to be working -
<s:property value="eventName" />
Although this works - <%= request.getParameter("eventName") %>
Thanks
The documentation says :
Assuming there's a request parameter myParameter (e.g. http://host/myApp/myAction.action?myParameter=one).
<s:property value="%{#parameters.myParameter}" />
There are some implicit objects in JSP pages that provide access to this sort of information. The one you are looking for is param. If you were writing jstl with c:out for example you could do:
<c:out value="${param.eventName}"/>
Or in your example:
<s:url id="open" action="viewEvent">
<s:param name="eventname" value="${param.eventName}"/>
</s:url>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With