cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Leszek Gawron <o...@wlkp.org>
Subject Re: strange ...
Date Tue, 09 Sep 2003 13:09:04 GMT
On Tue, Sep 09, 2003 at 02:35:10PM +0200, Bruno Dumon wrote:
I think this couldn't work as the Cocoon FOM when 
cocoon.request.getParameter( "test" ) is issued does 
request.getParameter( "test" );

while the xsp-request logicsheet performs encoding translation:

    public static String getParameter(Map objectModel, String name,
                                      String defaultValue, String form_encoding,
                                      String container_encoding) {
        if(container_encoding == null)
            container_encoding = "ISO-8859-1"; // default per Servlet spec

        Request request = ObjectModelHelper.getRequest(objectModel);
        String value = request.getParameter(name);
        if(form_encoding != null && value != null && value.length() > 0)
{
            try {
                value = new String(value.getBytes(container_encoding), form_encoding);
            } catch(java.io.UnsupportedEncodingException uee) {
                throw new CascadingRuntimeException("Unsupported Encoding Exception", uee);
           }
        }

        if (value == null) {
            value = defaultValue;
        }

        return value;
    }

	LG
-- 
            __
         | /  \ |        Leszek Gawron            //  \\
        \_\\  //_/       ouzo@wlkp.org           _\\()//_
         .'/()\'.     Phone: +48(501)720812     / //  \\ \
          \\  //  recursive: adj; see recursive  | \__/ |


Mime
View raw message