Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-1911

Relationship between portlet-name, PortletServlet mapping and requestdispatching to ServletFilters

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: 5.2.1, 5.2.2
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:
      5.2 branch revision 25818
      Liferay's internal portlet container (does not happen on Sun's portlet container)

      Description

      We're experiencing problems with dispatched request when a resourcerequest is called.
      We are using Wicket to build our portlets and this is working ok.

      However I have a question about the relationship between the portlet-name in portlet.xml, PortletServlet, the RequestDispatcher and servletfilters mapping .

      The only way we can get WicketPortlets to work is when the portlet-name (in portlet.xml) is exactly the same as the servletfilter mapping url-pattern in web.xml of the servletfilter. Example of what does work:

      web.xml
      ...
      <filter>
      <filter-name>example1</filter-name>
      <filter-class>org.apache.wicket.protocol.http.WicketFilter</filter-class>
      <init-param>
      <param-name>applicationClassName</param-name>
      <param-value>com.maxxton.portlet.example.WicketApplication</param-value>
      </init-param>
      </filter>

      <filter-mapping>
      <filter-name>example1</filter-name>
      <url-pattern>/example/*</url-pattern>
      <dispatcher>REQUEST</dispatcher>
      <dispatcher>FORWARD</dispatcher>
      <dispatcher>INCLUDE</dispatcher>
      </filter-mapping>
      ...

      portlet.xml
      ...
      <portlet>
      <description>As simple as it gets.</description>
      <portlet-name>example</portlet-name>
      <display-name>example</display-name>
      <portlet-info>
      <title>Example 1 Portlet</title>
      <keywords>Example 1</keywords>
      </portlet-info>
      </portlet>
      ...

      However if I change the portlet name to something else. The RequestDispatcher never finds the the filter when using a ResourceRequest.
      Example od what doesn't:

      <filter>
      <filter-name>example1</filter-name>
      <filter-class>org.apache.wicket.protocol.http.WicketFilter</filter-class>
      <init-param>
      <param-name>applicationClassName</param-name>
      <param-value>com.maxxton.portlet.example.WicketApplication</param-value>
      </init-param>
      </filter>

      <filter-mapping>
      <filter-name>example1</filter-name>
      <url-pattern>/exampleportlet/*</url-pattern>
      <dispatcher>REQUEST</dispatcher>
      <dispatcher>FORWARD</dispatcher>
      <dispatcher>INCLUDE</dispatcher>
      </filter-mapping>
      ...

      portlet.xml
      ...
      <portlet>
      <description>As simple as it gets.</description>
      <portlet-name>example</portlet-name>
      <display-name>example</display-name>
      <portlet-info>
      <title>Example 1 Portlet</title>
      <keywords>Example 1</keywords>
      </portlet-info>
      </portlet>
      ...

      The error that I get then is:
      "The requested resource (/example/exampleportlet/) is not available" (thrown in Tomcat)

      Is this intentional? As having a different portlet-name vs filter-mapping does work for Pluto/Jetspeed/Suns Portlet-Container)

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                8 years, 7 weeks, 6 days ago

                Subcomponents