struts-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thomas Howard (JIRA)" <j...@apache.org>
Subject [jira] Created: (WW-3455) ServletRedirectResult ignoring supressEmptyParameters option
Date Mon, 07 Jun 2010 09:09:55 GMT
ServletRedirectResult ignoring supressEmptyParameters option
------------------------------------------------------------

                 Key: WW-3455
                 URL: https://issues.apache.org/jira/browse/WW-3455
             Project: Struts 2
          Issue Type: Bug
    Affects Versions: 2.1.8.1
            Reporter: Thomas Howard


I've been attempting to use the supressEmptyParameters option on ServletRedirectResult but
it appears that this option is basically ignored in the code.  

Looking at the source it seems there's a line that adds the value to the requestParameters
map:

requestParameters.put(e.getKey().toString(),
                                e.getValue() == null ? "" :
                                        conditionalParse(e.getValue().toString(), invocation));

Which is then followed by the check of the empty parameters, which then attempts to add the
value again:

String potentialValue = e.getValue() == null ? "" : conditionalParse(e.getValue().toString(),
invocation);
                        if (!supressEmptyParameters || ((potentialValue != null) &&
(potentialValue.length() > 0))) {
                            requestParameters.put(e.getKey().toString(), potentialValue);
                        }

I'm guessing that the first line was either left in by mistake, or maybe got merged back into
place by mistake, but basically needs to be removed.

Thanks

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


Mime
View raw message