NullPointerException in PortletAction when trying to retrieve a VelocityPortletContext

  • Share
  • Share

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.

JAVA-Jetspeed , ,

  1. admin
    March 20th, 2009 at 10:28 | #1

    The above should be rewrittern as follows:

    ” method=”get”>
  1. No trackbacks yet.