[jbossseam-issues] [JBoss JIRA] Closed: (JBSEAM-2335) Page Parameters: incorrect validation code in org.jboss.seam.navigation.Pages

Pete Muir (JIRA) jira-events at lists.jboss.org
Thu Jan 10 12:27:43 EST 2008


     [ http://jira.jboss.com/jira/browse/JBSEAM-2335?page=all ]

Pete Muir closed JBSEAM-2335.
-----------------------------

    Resolution: Done

Thanks Wolfgang!

> Page Parameters: incorrect validation code in org.jboss.seam.navigation.Pages
> -----------------------------------------------------------------------------
>
>                 Key: JBSEAM-2335
>                 URL: http://jira.jboss.com/jira/browse/JBSEAM-2335
>             Project: JBoss Seam
>          Issue Type: Bug
>          Components: Core
>         Environment: CVS based Seam 2.0.1
>            Reporter: Wolfgang Schwendt
>         Assigned To: Pete Muir
>            Priority: Minor
>             Fix For: 2.0.1.GA
>
>
> Conversion and Validation of Page Parameters is initiated by org.jboss.seam.navigation.Pages.convertAndValidateStringValuesInPageContext(FacesContext facesContext)
> In that method, the conversion and validation of a page parameter is done in the wrong order.
> The code is currently as follows and does first the validation and afterwards the conversion.    It passes the unconverted (!) String value of the page parameter to method pageParameter.validateConvertedValue(facesContext, value).
> // org.jboss.seam.navigation.Pages.convertAndValidateStringValuesInPageContext()
>                String value = (String) Contexts.getPageContext().get( pageParameter.getName() );
>                if (value!=null)
>                {
>                   pageParameter.validateConvertedValue(facesContext, value);
>                   Object convertedValue = pageParameter.convertValueFromString(facesContext, value);
>                   Contexts.getEventContext().set( pageParameter.getName(), convertedValue );
>                }
>          
> It would be the correct approach, however,  to do first the conversion, and afterwards the validation of the converted value.
> // org.jboss.seam.navigation.Pages.convertAndValidateStringValuesInPageContext()
> String value = (String) Contexts.getPageContext().get( pageParameter.getName() );
>                if (value!=null)
>                {
>                   Object convertedValue = pageParameter.convertValueFromString(facesContext, value);
>                   pageParameter.validateConvertedValue(facesContext, convertedValue);
>                   Contexts.getEventContext().set( pageParameter.getName(), convertedValue );
>                }
> 	

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

        



More information about the seam-issues mailing list