title: Liferay ERROR [RuntimePageImpl-16] is not a valid include
body: <p>I'm struggling with the doView() method and initializing parameters from the portlet.xml. What I've been trying so far, is to just redirect to another view when I click a button, or a link. For that, I created two JSP:</p>
  
  <p>view.jsp
  vista2.jsp</p>
  
  <p>I define them in portlet.xml:</p>
  
  <pre><code>&lt;portlet&gt;
      &lt;portlet-name&gt;res-prot&lt;/portlet-name&gt;
      &lt;display-name&gt;Res Prot&lt;/display-name&gt;
      &lt;portlet-class&gt;com.test.ResProt&lt;/portlet-class&gt;
      &lt;init-param&gt;
          &lt;name&gt;view-jsp&lt;/name&gt;
          &lt;value&gt;html/resprot/view.jsp&lt;/value&gt;
      &lt;/init-param&gt;
      &lt;init-param&gt;
          &lt;name&gt;vista2-jsp&lt;/name&gt;
          &lt;value&gt;/vista2.jsp&lt;/value&gt;
      &lt;/init-param&gt;   
      (...)
  </code></pre>
  
  <p>Then, I initialize them in the init() method:</p>
  
  <pre><code>String viewJSP;
  String vista2JSP;
  
  public void init() throws PortletException {
      viewJSP = getInitParameter("view-jsp");
      vista2JSP = getInitParameter("vista2-jsp");
  }
  </code></pre>
  
  <p>Finally, I call to the doView() method, which calls the viewJSP if a parameter "navegacion" is empty:</p>
  
  <pre><code>@Override
      public void doView(RenderRequest renderRequest, RenderResponse renderResponse) throws IOException, PortletException {
          String destino = viewJSP;
  
          try {
              // we redirect only if "navegacion" is sent from the jsp
              if (renderRequest.getParameter("navegacion") != null){
                  if(renderRequest.getParameter("navegacion").equalsIgnoreCase("vista2JSP")){
                      destino = vista2JSP;
                  }
              }
              System.out.println("DESTINO: "+destino);
              include(destino, renderRequest, renderResponse);
          } catch (Exception e) {
              e.printStackTrace();
  
          }
      }
  </code></pre>
  
  <p>Then, in the vista2.jsp I just use a renderURL to do that call, but I don't even get there. I get this error and the portlet shows empty:</p>
  
  <blockquote>
    <p>09:21:41,402 ERROR [RuntimePageImpl-16][MVCPortlet:357]
    html/resprot/view.jsp is not a valid include</p>
  </blockquote>
  
  <p>This is how this dirty project is organized (remember that this is only for testing purposes):</p>
  
  <p><a href="https://i.stack.imgur.com/w6SuO.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/w6SuO.png" alt="enter image description here"></a></p>
  
  <p>What's failing here?</p>
  
  <p>EDIT: </p>
  
  <p>If I begin the route by "/", it throws a different error:</p>
  
  <blockquote>
    <p>DESTINO: /html/resprot/view.jsp java.lang.NullPointerException    at
    com.liferay.portal.kernel.portlet.LiferayPortlet.isValidPath(LiferayPortlet.java:425)
      at
    com.liferay.portal.kernel.portlet.LiferayPortlet.checkPath(LiferayPortlet.java:193)
      at
    com.liferay.util.bridges.mvc.MVCPortlet.include(MVCPortlet.java:360)
      at
    com.liferay.util.bridges.mvc.MVCPortlet.include(MVCPortlet.java:378)
      at com.test.ResProt.doView(ResProt.java:52)     at
    com.liferay.portal.kernel.portlet.LiferayPortlet.doDispatch(LiferayPortlet.java:235)
      at
    com.liferay.util.bridges.mvc.MVCPortlet.doDispatch(MVCPortlet.java:314)
      at javax.portlet.GenericPortlet.render(GenericPortlet.java:262)     at
    com.test.ResProt.render(ResProt.java:35)  at
    com.liferay.portlet.FilterChainImpl.doFilter(FilterChainImpl.java:103)
      at
    com.liferay.portlet.ScriptDataPortletFilter.doFilter(ScriptDataPortletFilter.java:55)
      at
    com.liferay.portlet.FilterChainImpl.doFilter(FilterChainImpl.java:100)
      at
    com.liferay.portal.kernel.portlet.PortletFilterUtil.doFilter(PortletFilterUtil.java:64)
      at
    com.liferay.portal.kernel.servlet.PortletServlet.service(PortletServlet.java:112)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)     at
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
      at
    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
      at
    com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
      at
    com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:119)
      at
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
      at
    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
      at
    org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:748)
      at
    org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:604)
      at
    org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:543)
      at
    com.liferay.portlet.InvokerPortletImpl.invoke(InvokerPortletImpl.java:583)
      at
    com.liferay.portlet.InvokerPortletImpl.invokeRender(InvokerPortletImpl.java:656)
      at
    com.liferay.portlet.InvokerPortletImpl.render(InvokerPortletImpl.java:362)
      at
    org.apache.jsp.html.portal.render_005fportlet_jsp._jspService(render_005fportlet_jsp.java:1239)
      at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)     at
    com.liferay.portal.servlet.DirectRequestDispatcher.include(DirectRequestDispatcher.java:57)
      at
    com.liferay.portal.servlet.ClassLoaderRequestDispatcherWrapper.doDispatch(ClassLoaderRequestDispatcherWrapper.java:78)
      at
    com.liferay.portal.servlet.ClassLoaderRequestDispatcherWrapper.include(ClassLoaderRequestDispatcherWrapper.java:53)
      at
    com.liferay.portlet.PortletContainerImpl._doRender(PortletContainerImpl.java:638)
      at
    com.liferay.portlet.PortletContainerImpl.render(PortletContainerImpl.java:135)
      at
    com.liferay.portlet.SecurityPortletContainerWrapper.render(SecurityPortletContainerWrapper.java:141)
      at
    com.liferay.portlet.RestrictPortletContainerWrapper.render(RestrictPortletContainerWrapper.java:126)
      at
    com.liferay.portal.kernel.portlet.PortletContainerUtil.render(PortletContainerUtil.java:156)
      at
    com.liferay.portal.layoutconfiguration.util.PortletRenderer._render(PortletRenderer.java:125)
      at
    com.liferay.portal.layoutconfiguration.util.PortletRenderer.access$4(PortletRenderer.java:107)
      at
    com.liferay.portal.layoutconfiguration.util.PortletRenderer$PortletRendererCallable.doCall(PortletRenderer.java:180)
      at
    com.liferay.portal.layoutconfiguration.util.PortletRenderer$PortletRendererCallable.doCall(PortletRenderer.java:1)
      at
    com.liferay.portal.kernel.executor.CopyThreadLocalCallable.call(CopyThreadLocalCallable.java:69)
      at java.util.concurrent.FutureTask.run(FutureTask.java:266)     at
    com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask._runTask(ThreadPoolExecutor.java:682)
      at
    com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask.run(ThreadPoolExecutor.java:593)
      at java.lang.Thread.run(Thread.java:745)</p>
  </blockquote>
  
  <p>EDIT 2: If I move "view.jsp" to the root folder, keeps throwing the same error:</p>
  
  <blockquote>
    <p>DESTINO: /view.jsp java.lang.NullPointerException     at
    com.liferay.portal.kernel.portlet.LiferayPortlet.isValidPath(LiferayPortlet.java:425)
      at
    com.liferay.portal.kernel.portlet.LiferayPortlet.checkPath(LiferayPortlet.java:193)
      at
    com.liferay.util.bridges.mvc.MVCPortlet.include(MVCPortlet.java:360)
      at
    com.liferay.util.bridges.mvc.MVCPortlet.include(MVCPortlet.java:378)
      at com.test.ResProt.doView(ResProt.java:52)     at
    com.liferay.portal.kernel.portlet.LiferayPortlet.doDispatch(LiferayPortlet.java:235)
      at
    com.liferay.util.bridges.mvc.MVCPortlet.doDispatch(MVCPortlet.java:314)
      at javax.portlet.GenericPortlet.render(GenericPortlet.java:262)     at
    com.test.ResProt.render(ResProt.java:35)  at
    com.liferay.portlet.FilterChainImpl.doFilter(FilterChainImpl.java:103)
      at
    com.liferay.portlet.ScriptDataPortletFilter.doFilter(ScriptDataPortletFilter.java:55)
      at
    com.liferay.portlet.FilterChainImpl.doFilter(FilterChainImpl.java:100)
      at
    com.liferay.portal.kernel.portlet.PortletFilterUtil.doFilter(PortletFilterUtil.java:64)
      at
    com.liferay.portal.kernel.servlet.PortletServlet.service(PortletServlet.java:112)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)     at
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
      at
    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
      at
    com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116)
      at
    com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:119)
      at
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
      at
    org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
      at
    org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:748)
      at
    org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:604)
      at
    org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:543)
      at
    com.liferay.portlet.InvokerPortletImpl.invoke(InvokerPortletImpl.java:583)
      at
    com.liferay.portlet.InvokerPortletImpl.invokeRender(InvokerPortletImpl.java:656)
      at
    com.liferay.portlet.InvokerPortletImpl.render(InvokerPortletImpl.java:362)
      at
    org.apache.jsp.html.portal.render_005fportlet_jsp._jspService(render_005fportlet_jsp.java:1239)
      at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)     at
    com.liferay.portal.servlet.DirectRequestDispatcher.include(DirectRequestDispatcher.java:57)
      at
    com.liferay.portal.servlet.ClassLoaderRequestDispatcherWrapper.doDispatch(ClassLoaderRequestDispatcherWrapper.java:78)
      at
    com.liferay.portal.servlet.ClassLoaderRequestDispatcherWrapper.include(ClassLoaderRequestDispatcherWrapper.java:53)
      at
    com.liferay.portlet.PortletContainerImpl._doRender(PortletContainerImpl.java:638)
      at
    com.liferay.portlet.PortletContainerImpl.render(PortletContainerImpl.java:135)
      at
    com.liferay.portlet.SecurityPortletContainerWrapper.render(SecurityPortletContainerWrapper.java:141)
      at
    com.liferay.portlet.RestrictPortletContainerWrapper.render(RestrictPortletContainerWrapper.java:126)
      at
    com.liferay.portal.kernel.portlet.PortletContainerUtil.render(PortletContainerUtil.java:156)
      at
    com.liferay.portal.layoutconfiguration.util.PortletRenderer._render(PortletRenderer.java:125)
      at
    com.liferay.portal.layoutconfiguration.util.PortletRenderer.access$4(PortletRenderer.java:107)
      at
    com.liferay.portal.layoutconfiguration.util.PortletRenderer$PortletRendererCallable.doCall(PortletRenderer.java:180)
      at
    com.liferay.portal.layoutconfiguration.util.PortletRenderer$PortletRendererCallable.doCall(PortletRenderer.java:1)
      at
    com.liferay.portal.kernel.executor.CopyThreadLocalCallable.call(CopyThreadLocalCallable.java:69)
      at java.util.concurrent.FutureTask.run(FutureTask.java:266)     at
    com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask._runTask(ThreadPoolExecutor.java:682)
      at
    com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask.run(ThreadPoolExecutor.java:593)
      at java.lang.Thread.run(Thread.java:745)</p>
  </blockquote>