You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Mark van den Boomen (JIRA)" <de...@myfaces.apache.org> on 2008/10/06 10:05:44 UTC

[jira] Commented: (TRINIDAD-1173) Character encoding problem when submitting with PPR and a filter getting parameters out the request

    [ https://issues.apache.org/jira/browse/TRINIDAD-1173?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12637041#action_12637041 ] 

Mark van den Boomen commented on TRINIDAD-1173:
-----------------------------------------------

Hello Mathias and Matthias,

I traced the problem to the 'TrinidadFilterImpl'-class. Btw Adf11g also has the bug. After examining the source code of the 'TrinidadFilterImpl'-class I noticed that there is a bug in the filters 'doFilter()'-method which handles the somehow request incorrectly. Because I have trouble to recompile a working Trinidad-impl.jar using Maven, I created a filter to get arround this problem:

public class TrinidadPprBugFilter implements Filter {
    private ServletContext _servletContext;

    public void init(FilterConfig filterConfig) {
        _servletContext = filterConfig.getServletContext();
    }

    public void doFilter(ServletRequest servletRequest, 
                         ServletResponse servletResponse, 
                         FilterChain filterChain) throws IOException, 
                                                         ServletException {
        ExternalContext externalContext = new ServletExternalContext(_servletContext, servletRequest, servletResponse);
        if (CoreRenderKit.isAjaxRequest(externalContext))
            servletRequest = XmlHttpConfigurator.getAjaxServletRequest(servletRequest);
        
        filterChain.doFilter(servletRequest,servletResponse);
    }

    public void destroy() {
    }
}

After placing this filter directly after the Trinidad or ADF 11g filter in web.xml the problems doesn't occur anymore.

So our problem is solved! And it works with no changes to the weppages.

It's maybe an idea to communicate this bug to the ADF11g developmentteam as the problem is 99% certain a bug in the filter.



> Character encoding problem when submitting with PPR and a filter getting parameters out the request
> ---------------------------------------------------------------------------------------------------
>
>                 Key: TRINIDAD-1173
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-1173
>             Project: MyFaces Trinidad
>          Issue Type: Bug
>          Components: Components
>    Affects Versions: 1.0.2-core, 1.0.3-core, 1.0.4-core, 1.0.5-core, 1.0.6-core, 1.0.7-core,  1.0.8-core, 1.0.9-core
>         Environment: JSF RI / Myfaces 1.1.4
> Embedded OC4J of jDeveloper 10.1.3.1 / Oracle Application Server 10.1.3.1.0 / Apache Tomcat 6.0.18
> Firefox and Internet Explorer 7
>            Reporter: Mark van den Boomen
>         Attachments: AdfTrinidadTest.war, AdfTrinidadTest.zip
>
>
> If a form is submitted with PPR and the application uses a filter which reads a parameter out of the request scope then somehow the character encoding screws up on other parameters. When the submitted value of a inputfield reaches the bean it's mallformed. This happends when the submitted value contains characters like 'ëìïòä'. With a normal submit this doesn't happen.
> Example:
> When 'België' is submitted, the bean receives 'België'.
> The problem doesn't occur with Trinidad 1.0.1, so after spitting through the Subversion logs I noticed TRINIDAD-46 which was released with release 1.0.2 and replaces lots of the PPR. Maybe somewhere in the new implementation of PPR is the cause of the problem.
> As said the problem happens when a filter is getting a parameter from the request (for example) like this:
>   String parameter = servletRequest.getParameter("test");
> If that line is removed from the filter Trinidad works normally.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.