Passing values in query string in jsp and struts

768 views Asked by At

I am passing below value which has special characters in query string to an action class.On hitting the action class the param1 value breaks and only empty. pdf is being passed in the url. I want to pass the entire string. How to achieve it?

<TD><A href=javascript:openWindow("lookuptest.do?action=download&param1=<%=test%>")><%="Download"%></a></TD>

where test value is [email protected]@test.pdf

2

There are 2 answers

1
Jay On

There is a missing double quote. If param1 value is hardcoded then try it in following way:

 href=javascript:openWindow("lookuptest.do?action=download&[email protected]@test.pdf")
0
nutty On
href=javascript:openWindow("lookuptest.do?action=download&param1=URLEncoder.encode([email protected]@test.pdf)")

This worked for me