[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 322
  • Last Modified:

japanese characters in the uri when deployed to tomcat do not work

hi,

I have deployed my application to tomcat 5. 0.25 on a windows-xp japanese machine .
The context name has combination of english and japanese characters.
1.When i launch the application as follows it gives resourse not found exception(Http 404).
http://localhost:portno/applicationname.
The application name is combination of english and japanese characters.
I overcame the problem of http-404 error by setting the encoding to UTF-8 in web.xml and uri encoding  to UTF-8 in the connector tag of server.xml.

Now the request comes to my application but req.getsession fails because the context name in the request is not encoded.Even though i have set the encoding to UTF-8  through the following statement
req.setCharacterEncoding("UTF-8");

The following is the exception :
javax.servlet.ServletException: app.HServlet.service(): error while processing CMD=null<br>java.lang.IllegalArgumentException: /appname??

the question marks in '/appname??' are nothing but the japanese characters which are not encoded properly.

Thanks
Srinivas

0
bgsrinivas
Asked:
bgsrinivas
1 Solution
 
aozarovCommented:
setCharacterEncoding only set the encoding for the BODY of the message not to the content of the URL.
I am not sure even if that is legal (in the HTTP protocl to have the URL part in non ascii).
I highly recommend you to not include japanese (or any non ascii characters) as part of the URL.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now