|
|
My proposal
Any questions and comments are welcome to me.
It is safe to move the responsibility to determine the charset from the server developer to the servlet writer. The practical solution to the problem above is to provide the servlet writer with the chance to determine the charset. Adding the following new method to HttpServletRequest will be enough:
My proposal to Servlet Specification described above is also applied to JSP specification.
JSP writer can set the Java character encoding (or RFC2616 charset) by:
request.setCharacterEncoding(String enc);
(Note that 'request' is one of the implicit object, which represents the instance of HttpServletRequest.)
<%@ page requestEncoding="Shif_JIS" %>
With this directive is specified, all the parameter values passed to the JavaBeans instance by:
<jsp:setProperty name="xxx" property="yyy" />
can be same as the original one.
As for HttpServletResponse, the servlet writer knows in which 'charset' the content should be sent to the client. And s/he can get the appropriate 'Writer' by calling 'setLocale()' or 'setContentType()' before 'getWriter()'. This is described clearly in
I'm eager for your opinion to my proposal!
Java and all Java-based trademarks and logos are trademarks or registered of Sun Microsystems, Inc. in the United States and other countries.
|
|
ALL CONTENTS COPYRIGHT 2000
, Jun Inamori. All rights reserved.
Any questions and comments are welcome to
Jun Inamori
.