Uploaded image for project: 'Struts 2'
  1. Struts 2
  2. WW-4382

Enhance Single Character Test

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 2.3.16.3
    • Fix Version/s: 2.5.x
    • Component/s: None
    • Labels:
    • Environment:

      Any

      Description

      When testing for a single character, Struts2 requires a very specific format that is not required for strings longer than 1 character:

      1 - Doesn't display anything

      <s:property value="hasLoginAccess" />
      <s:if test="hasLoginAccess == 'Y'">
      	&#x2713
      </s:if>
      

      2 - Displays checkmark

      <s:if test='hasLoginAccess == "Y"'>
      	&#x2713
      </s:if>
      

      While single quotes works comparing strings longer than 1 character, it does not work with 1 character strings. This is inconsistent behavior.

      For example, this test code matches because the string is longer than 1 character:

      <s:if test="clientUser.userName == 'wiley.coyote@acme.com'">
       	Matches
      </s:if>
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              ApexLars Larry D. Wilson
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: