How to pass a list of integers using s: a href and param tags in Struts 2?
POJO example:
private List<Integer> myList = new ArrayList<Integer>();
public List<Integer> getMyList() {
return myList;
}
public void setMyList(List<Integer> myList) {
this.myList = myList;
}
Example JSP Page:
<s:url id="testUrl" action="testAction">
<s:param name="myList" value="%{myList}" />
</s:url>
<s:a href="%{testUrl}">Test Link</s:a>
When I click "Test Link", the form submits the following for myList:
[1 + 2 + 3 + 4 + 5]
This causes Struts to redirect the input page. This is not the desired behavior. Does anyone have any suggestions on how to properly pass a list of integers using Struts tags?
David source
share