setCharacterEncoding() is only called in

1) ControlServlet.doGet()
Before being called (twice almost at the top) no request parameters or reading 
through getReader() are done but
request.getCharacterEncoding();
So I see no pb there

2) WebDAv, ResponseHelper.prepareResponse()
I see no pb there as well


2) RequestHandler.renderView()
Indeed here before being called we have this snippet:
        Map<String, Object> paramMap = UtilHttp.getParameterMap(req);
        // add in the attributes as well so everything needed for the rendering 
context will be in place if/when we get back to this view
        paramMap.putAll(UtilHttp.getAttributeMap(req));
        UtilMisc.makeMapSerializable(paramMap);
the rest before the setCharacterEncoding() call is not concerned (attributes)
I guess it's that you are referring to?

Jacques


Le 27/01/2015 05:20, 杜 文吉 a écrit :
I also find that ofbiz’s conponent of ecommerce cann’t process japanese 
properly.

The reason is that httpservletrequest’s mothod setCharacterEncoding is called 
too late.


The spec of method setCharacterEncoding is writed as follow:

Overrides the name of the character encoding used in the body of this request. 
This method must be called prior to reading request parameters or reading input 
using getReader(). Otherwise, it has no effect.


A filer should exist for calling setCharacterEncoding right after http request 
arrived.

and other setCharacterEncoding’s calls should be deleted.


Windows メール から送信

Reply via email to