Re: [enhydra] Problem with UTF-8

Slobodan Vujasinovic <[email protected]> Mon, 12 Sep 2005 13:47:10 +0200
Newsgroups gmane.comp.java.enhydra.general
Organization PROZONE
Message-ID <[email protected]>
This is a multi-part message in MIME format...

------------=_1126525880-14487-62
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

Hi Lofi,

For Tomcat HTTP connector you should try with setting 
"|useBodyEncodingForURI|" on "true".

|useBodyEncodingForURI - |specifies if the encoding specified in 
contentType should be used for URI query parameters, instead of using 
the URIEncoding. This setting is present for compatibility with Tomcat 
4.1.x, where the encoding specified in the contentType, or explicitely 
set using Request.setCharacterEncoding method was also used for the 
parameters from the URL. The default value is |false|.

New Enhydra Enterprise 6.5-1 contains revised Enhydra Director Connector 
implementation which also supports this (same) parameter.
Sorry, but "|useBodyEncodingForURI|" was not supported by Director 
Connector implementation included in EE 6.3-1 release!

Regards,
  Slobodan Vujasinovic
Enhydra Development Team



Lofi Dewanto wrote:

> Hi all,
>
> last time I wrote about UTF-8, I said that EE 6.3
> works to serve UTF pages with following things:
>
> 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" />
> ...
>
> Here are the discussions:
> http://www.objectweb.org/wws/arc/enhydra/2005-08/msg00038.html
> http://www.objectweb.org/wws/arc/enhydra/2005-08/msg00040.html
>
> Yes, it still works like this but I have now a different problem.
>
> Adding URIEncoding="utf-8" to the connector of Tomcat (server.xml)
> makes Tomcat to serve UTF-8 for *all* the connections under
> the port 9000. So all applications under this port will always
> serve UTF-8.
>
> My questions:
>
> How can I make Tomcat to handle UTF only *application dependent*
> and not the whole connection under 9000? I added following but
> still it won't work:
>
> 1) Remove URIEncoding="utf-8" from the server.xml, so Tomcat
> does not have to serve UTF-8 for all applications in port 9000.
>
> 2) Add these methods in StandardApplication:
> ...
> public boolean requestPreprocessor(HttpPresentationComms comms)
>                                 throws Exception {
>   comms.response.setEncoding("UTF-8");
>   comms.request.getHttpServletRequest().
>     setCharacterEncoding("UTF-8");
>   return super.requestPreprocessor(comms);
> }
> ...
>
> 3) Also add
>
> comms.request.getHttpServletRequest().
>   setCharacterEncoding("UTF-8");
>
> everytime before reading the request object. Actually
> this is already done in the number 2... But still both
> don't work.
>
> So, my conclusion is that UTF-8 access will only work if I
> add URIEncoding="utf-8" to the Tomcat connector
> within the server.xml...
>
> And this pops my second problem: if I used Director I cannot
> add this parameter since Director connector does not support it.
>
> Here are the parameter of Director Connector:
> <Connector 
> className="org.enhydra.servlet.connectionMethods.EnhydraDirector.EnhydraDirectorConnectionMethod" 
>
>   port="9000"
>   threadTimeout = "300"
>   clientTimeout = "30"
>   sessionAffinity = "true"
>   queueSize = "400"
>   numThreads = "200"
>   bindAddress = "(All Interfaces)"
>   authKey = "(Unauthenticated)"
> />
>
> Then I need to make my Apache to serve utf-8, which is not
> the solution, since my web server also serves older applications
> which are not UTF-8?
>
> Do we have any solutions here? Any helps are really appreciated!
>
> Thanks a lot community!
>
>------------------------------------------------------------------------
>
>
>--
>You receive this message as a subscriber of the [email protected] mailing list.
>To unsubscribe: mailto:[email protected]
>For general help: mailto:[email protected]?subject=help
>ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
>  
>


------------=_1126525880-14487-62
Content-Type: text/plain; name="message-footer.txt"
Content-Disposition: inline; filename="message-footer.txt"
Content-Transfer-Encoding: 8bit


--
You receive this message as a subscriber of the [email protected] mailing list.
To unsubscribe: mailto:[email protected]
For general help: mailto:[email protected]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws

------------=_1126525880-14487-62--