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

Wildcard mappings match not as expected

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.1.2
    • Component/s: XML Configuration
    • Labels:
      None

      Description

      Consider the following wildcard mapping in the struts.xml file

      <action name="List*s" class="actions.List

      {1}s">
      <result>list{1}

      s.jsp</result>
      </action>

      This mapping works as expected for actions with names like 'ListAccounts', but does not seem to work with the action named
      'ListSponsors'. My guess is that

      {1} is set to 'Spon' instead of the 'Sponsor' I expected. (The error messages are not very
      informative.)

      If this is the intended behaviour, it would be a good idea to document this with an example.

      In this particular case a workaround consist of using the following wildcard mapping instead

      <action name="List*" class="actions.List{1}

      ">
      <result>list

      {1}

      .jsp</result>
      </action>

      but in other cases it might not be so easy.

        Attachments

          Activity

            People

            • Assignee:
              mrdon Donald J. Brown
              Reporter:
              kcoolsae Kris Coolsaet
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: