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

RestfulActionMapper iterates a map where it should only just do a lookup

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Trivial
    • Resolution: Fixed
    • Affects Version/s: 2.1.8
    • Fix Version/s: 2.1.8
    • Component/s: Other
    • Labels:
      None
    • Flags:
      Patch

      Description

      getUriFromActionMapping in RestfulActionMapper does a map iteration where a simple lookup will do

      Proposed solution:

      public String getUriFromActionMapping2(ActionMapping mapping) {
      String base = mapping.getNamespace() + mapping.getName();
      Object value;
      if ((value = mapping.getParams().get(mapping.getName() + "Id")) != null)

      { base = base + "/" + value; }

      return base;
      }

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              sasmito Dion Sasmito
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: