Two Laptop Bag*
The moose likes JSP and the fly likes request.getParameter Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "request.getParameter" Watch "request.getParameter" New topic
Author

request.getParameter

stanley wang
Greenhorn

Joined: Jun 24, 2002
Posts: 12
Hi guys:
I am a chinese.
These days, I am tring to use the request.getParameter() to get the value of the textarea.
eg.
<textarea name="message_content" rows="6" cols="42" ><%=messagecontent%></textarea>
when the form submit I can get message_content value using the expression as follow:
eg.
messagecontent=request.getParameter("message_content")==null?"":request.getParameter("message_content");
but the strange thing is that :
I can get the English characters in correct way, but the Chinese word will be strange!
Anything wrong with me??
Thanx.
Manish Hatwalne
Ranch Hand

Joined: Sep 22, 2001
Posts: 2578

Use correct type of charset in your form tag and make sure that your browser supports it. You can do it using -
<form action="whatever" method="whatevver" ACCEPT-CHARSET="en-us,more_values_here">
<!-- Your textfield here -->
</form>
Have a look at this for listing of charset
http://www.w3.org/TR/REC-html40/types.html#type-charset
HTH,
- Manish
stanley wang
Greenhorn

Joined: Jun 24, 2002
Posts: 12
Thanx.
I can get the traditional Chinese, Simple Chinese at the same time. I change the page's charset="GBK" .It's very important.
I don't know why the GBK is correct and the GB2312 don't work.Could anybody do me a favor?
Thanx.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: request.getParameter
 
Similar Threads
The function of sRequest in JSP
Getting the selected option
XML in Textarea problem
would u like to open the file or save it to your system
regarding custom tags rtexprvalue