I have a jsp file that contains this code,
<form id="testForm">
<input type="hidden" value="study--study is negative--echocardiogram--" name="hidAllProc"/>
</form>
Now, I serialize this form using jQuery’s .serialize() function and send it in a post request to another jsp, and then in this jsp I simply send the “request” object to a java class and use request.getParameters(“hidAllProc”) to retrieve the hidden field value.
Now, the problem is that I tried to print the value that I get in the java class and it was like this, “study..study is negative..echocardiogram..”. All the “–” have been replaced by “..”. I encountered this behavior only in a particular PC. This code runs perfectly in my and my friends PC. I need help since I tried alomost every possible thing that I can and have exhausted of all ideas!
Thanks,
Rishabh
jQuery
serializeserializes using utf8.You might want to try put
at the top of the receiving page, it’s the codepage for utf8.
If it doesn’t work, on your java class, you can decode your your input with