Reputation: 1760
I have a jsp containing a form which posts to a servlet, when the servlet receives the parameters from the form the pound sign (£) is preceded with the following character Â. So £ becomes £. What is causing this and how can I get round it?
Upvotes: 2
Views: 2326
Reputation: 1149
What you can do is, in your JSP page before retrieving from request object,set content type for your request.[e.g. request.setCharacterEncoding("utf-8");]
Now you can do request.getParameter("yourParamName");
I also faced same issue & solved as explained above.
Upvotes: 1
Reputation: 103787
This sounds a lot like a character encoding issue. The response containing the pound sign is being sent in the UTF-8 character set, but is being interpreted in a different character set (probably ISO-8859-1).
Check what character encoding you are specifying for your JSP, and if the problem still persists, use a sniffer to investigate the response that the form posts, and specifically any character set it specifies. By default the form should use the same character set as the page it was served on, so you should be able to control it by checking the page's character set.
Upvotes: 2