NullPointerException in PortletAction when trying to retrieve a VelocityPortletContext
March 20th, 2009
Applies to:
Jetspeed
Description:
In Your action class extending JspPortletAction, You have tried to use the setTemplate method, but it did not work. It thrown a NullPointerException in PortletAction when trying to retrieve a “VelocityPortletContext” (how surprising when working with a JSPPortlet)
Cause:
Most common mistake with portlets is to use the hidden action variable and set it to the portlet’s action class:
In the above example, Turbine executes the action before the portlet and therefore the context is null.
The above should be rewrittern as follows:
” method=”get”>