Reputation: 1744
I have used these imports:
org.apache.commons.lang3.StringEscapeUtils
java.util.Properties,java.util.Map
and few other package imports.
I have placed this code:
<%@page language="java" contentType="text/html; charset=UTF-8" %>
and this code: <% WebAppConfig webConf = new WebAppConfig( this.getServletContext() );
request.setCharacterEncoding("UTF-8");
%>
But there are few russian characters that I can not get. I'm trying to get 2 names declared as parameters in the URL, without any luck. The URL is not encoded/escaped.
I tried 2 ways to get the parameter without any luck.
1st I tried: String fullName = request.getParameter("fullName");
What I got is: ������� ����� �����������
Then I tried to pass the variables to a bean:
EEventBean ee = new EEventBean();
and
ee.setFullName(request.getParameter("fullName"));
The output was the same.
The way I'm trying to print the result is:
<tr>
<td width="50%">осударственного работника</td>
<td width="50%" class="value"><%= ee.getFullName() %></td>
</tr>
Every russian word can be showed in the form, but I can't show the 2 parameters...
Is there a way to get the correct parameter from the URL?
EDIT: the server is Tomcat 5.5.28
Upvotes: 1
Views: 251
Reputation: 32286
What HTTP server are you using? It might well be failing to handle non-ASCII data when rendering JSP. Tomcat had a similar issue a few versions back: UTF-8 encoding fix for Tomcat and JSP.
Upvotes: 2