Reputation: 1246
This code should send two parameters to the struts action:
<s:url id="loadReportsForAPageInitial" value="/loadReportsForAPage.action" >
<s:param name="reportsCount_hidden" value="3"></s:param>
<s:param name="pageNumber_hidden" value="1"></s:param>
</s:url>
<sj:div href="%{loadReportsForAPageInitial}">
</sj:div>
the problem is only the first parameter's value is sent to the struts action and the second one is null! I changed the place of two parameters and again only the first one was fine.
Is it possible to pass more than one parameter via a s:url tag?
UPDATE
this is how the url tag is rendered:
<script type='text/javascript'>
jQuery(document).ready(function () {
var options_div_1179027906 = {};
options_div_1179027906.jqueryaction = "container";
options_div_1179027906.id = "div_1179027906";
options_div_1179027906.href = "/FAP/loadReportsForAPage.action";
options_div_1179027906.hrefparameter = "reportsCount_hidden=3&pageNumber_hidden=1";
jQuery.struts2_jquery.bind(jQuery('#div_1179027906'),options_div_1179027906);
});
Upvotes: 8
Views: 18092
Reputation: 196
You may disable the URL escape behavior using escapeAmp="false"
attribute. By default, this is enabled, so URL parameter &
will render &
. This will cause a problem on reading the parameter value with parameter name.
request.getParameter("amp;pageNumber_hidden")
escapeAmp
and set the value false as part of the <s:url>
tag (Recommended)<s:url id="loadReportsForAPageInitial"
value="/loadReportsForAPage.action"
escapeAmp="false">
Upvotes: 18