DefaultRequestHelper fails with Null parameter
----------------------------------------------

         Key: DISPL-228
         URL: http://jira.codehaus.org/browse/DISPL-228
     Project: DisplayTag
        Type: Bug
    Versions: 1.0    


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: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
displaytag-devel mailing list
displaytag-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/displaytag-devel

Reply via email to