You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by MIYABE Tatsuhiko <mi...@jzf.co.jp> on 2001/12/21 00:54:37 UTC
Request parameters problem
Now, I'm developing web application using Cocoon2.
But I came up against some problems in relation to Japanese language
processing.
Yesterday, I considered how to solve them fundamentally.
Servlet2.2 has problems about charactor encoding of HTTP request,
therefore We decode multibyte text with following code compulsory.
String value = request.getParameter("foo");
byte[] bytes = value.getBytes("ISO-8859-1");//Encode in servlet container
encoding.
value = new String(bytes, "Shift_JIS");//Decode in national encoding.
Servlet2.3 solved problems by adding setCharacterEncoding into
javax.servlet.ServletRequest.
By the way,Cocoon2 has some components that using request parameters.
If I'll develop patches for multibyte text, then I must write the above
codes for reason of Cocoon2 build with Servlet2.2.
I think,these deformities should solve in
org.apache.cocoon.environment.Request.
One of a solution is adding this method for the Request.It likes Servlet2.2.
But it is a enhancement for Cocoon2 for solving Servlet2.2's problem.(not
corresponding)
setCharacterEncoding(String form_encoding);
Components should use this method when accessing request parameters.
And may be necessary following method.
setContainerEncoding(String container_encoding);
However,I think that container_encoding should be contained application
configuration(cocoon.xconf) instead of above method.
For example:
<servlet-container>
<parameter name="container-encoding" value="Shift_JIS"/>
</servlet-container>
I want to learn developers opinions.
--
MIYABE Tatsuhiko
miyabe@jzf.co.jp
Osaka, Japan.
---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org