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)
-
Similar Issues:
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)

Use the attached Wicket Example portlet to reproduce the error.
DO NOT use the Liferay 5.2 bundle..you must use 5.2 branch revision 25818.
Run Liferay with suns portlet-container, deploy the portlet. Now clicking the "add 1 to counter" link will increment the counter by 1 as it should.
Run this in Liferay 5.2.0 with the internal portlet-container and clicking "add 1 to counter" won't have effect.
In the right lower corner is a "Wicket Ajax Debug" link this shows debug information on the Ajax request. Here a message will show:
"The requested resource (/example-noerror-1.0-SNAPSHOT/examplenoerror/) is not available".
ERROR: Error while parsing response: Could not find root <ajax-response> element