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

Posted on 2005-04-20
Last Modified: 2013-11-24

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).
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

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.


Question by:bgsrinivas
    1 Comment
    LVL 15

    Accepted Solution

    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.

    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    EvenOdd challenge 10 69
    Java: Convert List<Object[]> to List<MyBean> 3 34
    changeXy challenge 13 41
    firstChar challenge 13 60
    Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
    Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
    Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
    This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now