Form submission problem with UTF8

Hello,

We're using Weblogice 6.1 in Windows 2000.

We encounter a problem about the JSP form submission when we add

the following lines in web.xml

<context-param>

<param-name>weblogic.httpd.inputCharset./*</param-name>

<param-value>UTF-8</param-value>

</context-param>

When we submit a form from the first JSP to the second JSP,

we try to use the request.getParameter() in the second JSP to retrieve the value(input in the first JSP), the return from request.getParameter() are all null.

And we found that, if we remove the about lines in web.xml, the mentioned problem is disappear. However, those chinese (or UTF8) character cannot be handled properly. We're in a dilemma.

Please gives advice on it. Thanks.

[839 byte] By [kammau] at [2007-9-19]
# 1
I am being faced with the same problem,help me!
Jacky_bupt at 2007-7-5 > top of java,Enterprise & Remote Computing,Web Tier APIs...
# 2
Try submitting the form using a "post", if you are using a "get". It worked for me in a similar problem.
juani1 at 2007-7-5 > top of java,Enterprise & Remote Computing,Web Tier APIs...
# 3
Thanks for your suggestion.But I am using "post" in all forms, It doesn't work for me.
kammau at 2007-7-5 > top of java,Enterprise & Remote Computing,Web Tier APIs...
# 4
hi,kammau ,we shoud set something about character encoding using some method of request object,but I cannot find it.All errors are formed when processing requests
Jacky_bupt at 2007-7-5 > top of java,Enterprise & Remote Computing,Web Tier APIs...
# 5

Hello,

I encounter the same problem too. I use the getParameterMap() and found that the ParameterMap are all empty.

Also, I found that if I use "GET" method in the form, I can make it success. However, we need

to use "POST" method.

Jacky_bupt: Would you please be specific what you are looking for about the encoding, so I can

have some idea to work on it?

Thanks for the help!!

chusir at 2007-7-5 > top of java,Enterprise & Remote Computing,Web Tier APIs...
# 6
I have solved the problem already.If you are using weblogic server 6.1, go to download sp2, then it will be ok.
kammau at 2007-7-5 > top of java,Enterprise & Remote Computing,Web Tier APIs...
# 7

following is a very stupid approach:

String some=request.getParameter("some");

String real;//what I really want

try{

byte[] b=some.getBytes("ISO8859-1");

real=new String(b);

}catch(Exception e){

real=null;

}

It works fine,but if I have to use it,It's hell to change all my codes!!

who has better ways?help me,

thanks

Jacky_bupt at 2007-7-5 > top of java,Enterprise & Remote Computing,Web Tier APIs...