[ http://jira.codehaus.org/browse/DISPL-228?page=comments#action_46533 ] 

Eric Fazendin commented on DISPL-228:
-------------------------------------

I have a filter set up that converts empty string parameters to null values in 
order to maintain consistency in a database and to reduce complexity of value 
checking.  You're right, normally there would be an array of an empty String, 
but I manually convert those to null.  Thanks for the fix.

> DefaultRequestHelper fails with Null parameter
> ----------------------------------------------
>
>          Key: DISPL-228
>          URL: http://jira.codehaus.org/browse/DISPL-228
>      Project: DisplayTag
>         Type: Bug
>     Versions: 1.0
>      Fix For: 1.1

>
>
> DefaultRequestHelper fails when request parameter values are set to Null.
> Code change recommended:
> From:
> // put key/value in the map
> String[] originalValues = this.request.getParameterValues(paramName);
> String[] values = new String[originalValues.length];
> for (int i = 0; i < values.length; i++)
> {
>     values[i] = 
> CompatibleUrlEncoder.encode(StringUtils.defaultString(originalValues[i]), 
> response
>         .getCharacterEncoding());
> }
> map.put(paramName, values);
> To:
> // put key/value in the map
> String[] originalValues = this.request.getParameterValues(paramName);
> if (originalValues==null)
> {
>     originalValues = new String[] {""};
> }
> String[] values = new String[originalValues.length];
> for (int i = 0; i < values.length; i++)
> {
>     values[i] = 
> CompatibleUrlEncoder.encode(StringUtils.defaultString(originalValues[i]), 
> response
>         .getCharacterEncoding());
> }
> map.put(paramName, values);

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



-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
displaytag-devel mailing list
displaytag-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/displaytag-devel

Reply via email to