title: Null Pointer Exception on Primefaces MenuItem outcome attribute
body: <p>I'm using prime faces 4.0 on a jsf 2.2 web project. I'm using template including the menu bar and footer part of the page.</p>
  
  <p>I created a folder named <code>user</code> for accessing the pages under it via an authentication filter redirecting unauthorized requests to a proper page.</p>
  
  <p>but the links on the menu bar which are directing to the pages under <code>user</code> folder throws exception as below:</p>
  
  <pre><code>HTTP Status 500 -
  
  type Exception report
  
  message
  
  description The server encountered an internal error that prevented it from fulfilling this request.
  
  exception
  
  javax.servlet.ServletException
      javax.faces.webapp.FacesServlet.service(FacesServlet.java:659)
      org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)
  root cause
  
  java.lang.NullPointerException
      org.primefaces.renderkit.OutcomeTargetRenderer.getTargetURL(OutcomeTargetRenderer.java:80)
  org.primefaces.component.menu.BaseMenuRenderer.encodeMenuItem(BaseMenuRenderer.java:148)
  org.primefaces.component.tieredmenu.TieredMenuRenderer.encodeElements(TieredMenuRenderer.java:103)
  org.primefaces.component.tieredmenu.TieredMenuRenderer.encodeSubmenu(TieredMenuRenderer.java:162)
  org.primefaces.component.tieredmenu.TieredMenuRenderer.encodeElements(TieredMenuRenderer.java:119)
  org.primefaces.component.tieredmenu.TieredMenuRenderer.encodeMenu(TieredMenuRenderer.java:78)
  org.primefaces.component.menubar.MenubarRenderer.encodeMarkup(MenubarRenderer.java:49)
  org.primefaces.component.menu.BaseMenuRenderer.encodeEnd(BaseMenuRenderer.java:105)
  javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:919)
  javax.faces.component.UIComponent.encodeAll(UIComponent.java:1903)
  javax.faces.render.Renderer.encodeChildren(Renderer.java:176)
  javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:889)
  org.primefaces.renderkit.CoreRenderer.renderChild(CoreRenderer.java:70)
  org.primefaces.renderkit.CoreRenderer.renderChildren(CoreRenderer.java:57)
  org.primefaces.component.layout.LayoutUnitRenderer.encodeEnd(LayoutUnitRenderer.java:51)
  javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:919)
  javax.faces.component.UIComponent.encodeAll(UIComponent.java:1903)
  javax.faces.component.UIComponent.encodeAll(UIComponent.java:1899)
  javax.faces.component.UIComponent.encodeAll(UIComponent.java:1899)
  javax.faces.component.UIComponent.encodeAll(UIComponent.java:1899)
  com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:451)
  com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:131)
  javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:337)
  com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:120)
  com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
  com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:219)
  javax.faces.webapp.FacesServlet.service(FacesServlet.java:647)
  org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)
  note The full stack trace of the root cause is available in the Apache Tomcat/7.0.47 logs.
  
  Apache Tomcat/7.0.47
  </code></pre>
  
  <p>And the menu items under the template file(which is under <code>WEB-INF</code> directory) is like below:</p>
  
  <pre><code>&lt;p:menuitem value="User Data" outcome="/user/userData" rendered="#{sessionBean.loggedIn}"/&gt;
  
  &lt;p:menuitem icon="ui-icon-grip-dotted-vertical" rendered="#{sessionBean.loggedIn}"/&gt;
  
  &lt;p:submenu label="Yardım" &gt;
      &lt;p:menuitem value="About Us" outcome="about" icon="ui-icon-help" /&gt;
  &lt;/p:submenu&gt;
  </code></pre>
  
  <p>I can't access the <code>userData.xhtml</code>(and any other) under <code>user</code> folder and i get the exception above. i placed a plain html page under <code>user</code> folder and i can access it.</p>
  
  <p>I tried so many things but couldn't find the problem.
  Any help appreciated. </p>