Action specified for the Command button in the Facelet of a JSF 2.0 portlet project

Technote (troubleshooting)


Problem(Abstract)

An exception is thrown on the console when the command button(without action specified) in a facelet of a JSF 2.0 portlet project is clicked at runtime..

Symptom

Following exception is thrown on the console when the Command button (without specified action) in the facelet of a JSF 2.0 portlet project is clicked at run time:

Caused by: java.lang.NullPointerException
at com.ibm.ws.portletcontainer.core.impl.PortletContextImpl.getRequestDispatcher(PortletContextImpl.java:57)
at com.ibm.faces20.portlet.httpbridge.PortletRequestWrapper.getRequestDispatcher(PortletRequestWrapper.java:439)
at org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:355)
at com.ibm.faces20.portlet.httpbridge.PortletExternalContextWrapper.dispatch(PortletExternalContextWrapper.java:107)
at org.apache.myfaces.view.jsp.JspViewDeclarationLanguage.buildView(JspViewDeclarationLanguage.java:94)
at org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:66)
at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:239)
at com.ibm.faces20.portlet.FacesPortlet.doRender(FacesPortlet.java:487)
... 282 more

Cause

Since the target action is not specified for button, the target view state cannot be restored. Hence exception is thrown on console.

Resolving the problem

Specify an action for the Command button in the facelet of a JSF 2.0 portlet project.. The action can be defined in two ways:

a) Specify facelet name as an action for the Command button.

b) Specify a method for the action of Command button, and that method can return the name of the facelet.


Rate this page:

(0 users)Average rating

Document information


More support for:

Rational Application Developer for WebSphere Software
Portal / Portlet Development

Software version:

8.5, 8.5.1, 9.0

Operating system(s):

Linux, Windows

Reference #:

1596588

Modified date:

2013-07-15

Translate my page

Machine Translation

Content navigation