I'm having an issue related to url encoding in my struts 2 application. I did some research but could not find the correct way to do this.
My application prepares the url dynamically and gets the variable by querying the database. The valid URL that I'm expecting is
http://www.test.com/language=english&numbers=X,Y,Z
However, when on UI because of URL encoding i get the URL as below
http://www.test.com/language=english&numbers=X%2CY%2CZ
numbers is a single variable and database returns the value as X,Y,Z.
I'm preparing the URL in jsp as below
<s:url id="testUrl" escapeAmp="false" value="http://www.test.com">
<s:param name="language" value="%{'english'}" />
<s:param name="numbers" value="%{Num}" />
</s:url>
I did try encode="false" in the s:url tag but to no avail.
The testUrl is is hyperlinked as below
<a href="<s:property value="#testUrl" />" target="_blank">
<s:property value="#Num" />
</a>
I understand that comma(,) is a reserved character and should be encoded. However, in my URL i need that comma so as to execute the url successfully when clicked.
I'm using char set iso-8859-1.