Reputation: 9158
I have a JSP page where the user can input unicode characters and the server has to store those unicode characters properly into the SQL Server database.
My code in which I set page encoding in JSP and character encoding in a filter used to work perfectly in Apache Geronimo. However, when I deploy the same code in GlassFish 4.0, it started storing "?" in the database.
I followed the instructions given in this blog post and added parameter-encoding tag in glassfish-web.xml and also added jsp-config in web.xml
and in my Servlet i am converting the input to UTF as new String([Parameter].getBytes("ISO-8859-1"), "UTF-8") Here it gives me ?
I am not able to figure out what am I doing wrong. Please suggest a workaround.
Upvotes: 2
Views: 981
Reputation: 9158
@developerwjk Thank you for the hint. There is a property SendStringParametersAsUnicode in Additional Properties of JDBC Connection Pool. This we have to set to true.
In fact, after doing this, it is working with out above said entries in web.xml and glassfish-web.xml.
Upvotes: 2