logo       

Re: [enhydra] Problem with UTF-8 and POST method in EE 6.3: msg#00040

java.enhydra.general

Subject: Re: [enhydra] Problem with UTF-8 and POST method in EE 6.3

Hi Slobodan,

thanks for your fast reply!

<quote>
please try with
comms.request.getHttpServletRequest().setCharacterEncoding("utf-8");
before reading POST request parameters!
</quote>

This doesn't help...


Here is what I've done sofar:

1) Change the HTML file to have this line:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

2) Add this line into xmlc file:
-html:encoding utf-8

3) Add this line into presentation.conf:
Application.Encoding = "utf-8"

4) Add this to server.xml -> URIEncoding="utf-8"
...
<Connector port="9000"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" redirectPort="9043" acceptCount="100"
debug="0" connectionTimeout="20000" URIEncoding="utf-8"
disableUploadTimeout="true" />
...

This works for all HTML files and also all forms with GET
method but not for POST method.

I found that (maybe?) I need to add this in my POST method:
enctype="multipart/form-data; charset=utf-8"
...
<form method="post" action="MainPageOfDiscussionForAssistant.html" name="FileUpload" id="FormMethod" enctype="multipart/form-data; charset=utf-8">
...

But then I always get an exception in this code:
...
String contentType = comms.request.getContentType();
// Create the content header
ContentHeader contentHdr = new ContentHeader("Content-Type: " +
contentType);
// Get the input stream
HttpPresentationInputStream input = comms.request.getInputStream();
// Create the multiple mime
MultipartMimeInput mime = new MultipartMimeInput(input, contentHdr);
==> EXCEPTION: MIME type error

If I change the enctype back into: enctype="multipart/form-data"
I won't get any exeception but I get wrong chars for all German
umlauts (üöäß)...

Any other hints? Thanks a lot!
--
---------------------------------------------------
Blasius Lofi Dewanto
---------------------------------------------------
OpenUSS - Open University Support System
http://openuss.sourceforge.net
---------------------------------------------------
E-Mail : dewanto@xxxxxxxxxxxxxxx
---------------------------------------------------



--
You receive this message as a subscriber of the enhydra@xxxxxxxxxxxxx mailing
list.
To unsubscribe: mailto:enhydra-unsubscribe@xxxxxxxxxxxxx
For general help: mailto:sympa@xxxxxxxxxxxxx?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise