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

Inconsistency between implementation and docs about portlet action path

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0.2
    • 2.0.3
    • Plugin - Portlet
    • None

    Description

      http://struts.apache.org/2.x/docs/portlet-configuration.html , sample for portlet.xml states:

      <init-param>
      <!-- Portlet namespace -->
      <name>portletNamespace</name>
      <value>/portletA</value>
      </init-param>
      <init-param>
      <!-- The base namespace of the view portlet mode -->
      <name>viewNamespace</name>
      <value>/view</value>
      </init-param>
      <init-param>
      <!-- The default action to invoke in view mode -->
      <name>defaultViewAction</name>
      <value>index</value>
      </init-param>

      but actually this will not work.
      Paths are calculated in
      org.apache.struts2.portlet.dispatcher.Jsr168Dispatcher
      starting in line 250 (method parseModeConfig)

      The problem is that the calculated path from the above example will have double slash:

      /portletA//view/index

      and this will not work.
      I believe the code should be fixed and the wiki description is correct.

      In addition to that such code may be corrected:
      fullPath.append(namespace + "/");
      to
      fullPath.append(namespace).append("/");

      Attachments

        Activity

          People

            mrdon Donald J. Brown
            dwojtas@gmail.com Dariusz Wojtas
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: