You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Lukasz Lenart (JIRA)" <ji...@apache.org> on 2014/01/10 12:08:51 UTC

[jira] [Updated] (WW-4275) Cast exception on Supressing empty parameters on tag

     [ https://issues.apache.org/jira/browse/WW-4275?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Lukasz Lenart updated WW-4275:
------------------------------

    Description: 
I have noticed that my patch does not handle integers correctly, alas, we need to do another change

It does kind of the same check, but this works with integers/doubles.

{code}
Object value = findValue(this.value);
if (suppressEmptyParameters) {
if (value != null && !value.toString().isEmpty()){ 
  component.addParameter(name, value); }
} else{
  component.addParameter(name, value); 
}
{code}

existing code:
{code}
if (suppressEmptyParameters) {
String potentialValue = (String) value;
if (potentialValue != null && potentialValue.length() > 0) { component.addParameter(name, value); }
} else { component.addParameter(name, value); }
{code}

  was:
I have noticed that my patch does not handle integers correctly, alas, we need to do another change

It does kind of the same check, but this works with integers/doubles.

<code>
Object value = findValue(this.value);
if (suppressEmptyParameters) {
if (value != null && !value.toString().isEmpty())
{ component.addParameter(name, value); }

} else
{ component.addParameter(name, value); }
</code>

existing code:
<code>
if (suppressEmptyParameters) {
String potentialValue = (String) value;
if (potentialValue != null && potentialValue.length() > 0) { component.addParameter(name, value); }
} else { component.addParameter(name, value); }

</code>


> Cast exception on Supressing empty parameters on <s:a> tag 
> -----------------------------------------------------------
>
>                 Key: WW-4275
>                 URL: https://issues.apache.org/jira/browse/WW-4275
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - Java Templates
>    Affects Versions: 2.3.16
>         Environment: Tomcat/Cenots
>            Reporter: Greg Huber
>            Assignee: Greg Huber
>            Priority: Minor
>             Fix For: 2.3.17
>
>
> I have noticed that my patch does not handle integers correctly, alas, we need to do another change
> It does kind of the same check, but this works with integers/doubles.
> {code}
> Object value = findValue(this.value);
> if (suppressEmptyParameters) {
> if (value != null && !value.toString().isEmpty()){ 
>   component.addParameter(name, value); }
> } else{
>   component.addParameter(name, value); 
> }
> {code}
> existing code:
> {code}
> if (suppressEmptyParameters) {
> String potentialValue = (String) value;
> if (potentialValue != null && potentialValue.length() > 0) { component.addParameter(name, value); }
> } else { component.addParameter(name, value); }
> {code}



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)