logo       

[enhydra] Problem with UTF-8: msg#00003

java.enhydra.general

Subject: [enhydra] Problem with UTF-8

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!
--
---------------------------------------------------
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