[jboss-jira] [JBoss JIRA] Commented: (JBPORTAL-2440) Incorrect values of escapeXml in actionURL result in confusing NullPointerException in JBoss Portlet Container

Bernard de Terwangne (JIRA) jira-events at lists.jboss.org
Mon Aug 3 04:34:29 EDT 2009


    [ https://jira.jboss.org/jira/browse/JBPORTAL-2440?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12478566#action_12478566 ] 

Bernard de Terwangne commented on JBPORTAL-2440:
------------------------------------------------

in org.jboss.portal.portlet.controller.impl.ControllerRequestFactory around line 205 test queryParameters.get(ControllerRequestParameterNames.PUBLIC_NAVIGATIONAL_STATE_CHANGES) for a null value and throw a more explicit exception

   /**
    * Create a controller request.
    *
    * @param queryParameterMap the query parameter map
    * @param formParameterMap the optional form parameter map
    * @return the decoded controller request
    */
   public ControllerRequest decode(Map<String, String[]> queryParameterMap, Map<String, String[]> formParameterMap)
   {
      ...
         }
         else
         {
            String publicNavigationalStateChangesB64 = queryParameters.get(ControllerRequestParameterNames.PUBLIC_NAVIGATIONAL_STATE_CHANGES);
            if (publicNavigationalStateChangesB64 != null)
            {
               byte[] bytes = Base64.decode(publicNavigationalStateChangesB64, true);
               Map<String, String[]> publicNavigationalStateChanges = IOTools.unserialize(Serialization.PARAMETER_MAP, SerializationFilter.COMPRESSOR, bytes);
   
               //
               return new PortletRenderRequest(
                  windowId,
                  windowNavigationalState,
                  publicNavigationalStateChanges,
                  pageNavigationalState);
            }
            else
            {
               //see JBPORTAL-2440 - Incorrect values of escapeXml in actionURL result in confusing NullPointerException in JBoss Portlet Container
               throw new UnsupportedOperationException("Malformed portlet request. May be caused by incorrect escapeXml value");
            }
         }
      }
   }


> Incorrect values of escapeXml in actionURL result in confusing NullPointerException in JBoss Portlet Container
> --------------------------------------------------------------------------------------------------------------
>
>                 Key: JBPORTAL-2440
>                 URL: https://jira.jboss.org/jira/browse/JBPORTAL-2440
>             Project: JBoss Portal
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>          Components: Portal Core
>    Affects Versions: Portlet-2.0.1
>         Environment: Any
>            Reporter: Bernard de Terwangne
>            Priority: Minor
>
> JSR-286 states that escapeXml defaults to true. This value is almost never appropriate. If you forget to set it to false explicitly (very common mistake) you get a very confusing and little explicit NullPointerException.
> I suggest to throw a more explicit exception so that developpers don't loose a lot of time wondering why their apps don't work. I can provide the fix if requested.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list