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

Hability PrefixBasedActionMapper to exclude the prefix when retrieveing the ActionMapper

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Not A Problem
    • 2.2.3
    • 2.3.20
    • Dispatch Filter
    • None

    Description

      The PrefixBasedActionMapper is able to map different actions to different mappers using prefixes. So you can have something like this:

      /preffix1:mapper1,/preffix2:mapper2,:defaultMapper

      And the following URIs would be processed by different mappers

      /preffix1/mynamespace1/myaction1 (by mapper1)
      /preffix2/mynamespace1/myaction1 (by mapper2)
      /mynamespace1/myaction1 (by defaultMapper)

      So you can have three different ActionMappers, one per prefix. The problem with this is that you can not reuse the same actions for different prefixes(ie, reuse an ActionMapper), since the ActionMapper will try to match the full URI, without taking out the prefix. I suggest to parametrize the PrefixBasedActionMapper to remove the preffix from the URI when calling the ActionMapper, so the same mapper can be used more than once.

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            jlmagc Jose L Martinez-Avial
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment