title: Spring NestedServletException: Request processing failed exception is tiles CannotRenderException: ServletException including path
body: <p>I am new to Spring,
  I am using SPRING 3.0.4 REST MVC with tiles 2.2.2,
  My question is very clear, when I tried to submit a request with simpler path's which I have configured in mvc-servlet.xml like /WEB-INF/jsp, it runs successfully, but when I tried to access path /WEB-INF/jsp/XYZ/xyz.jsp or /WEB-INF/jsp/ABC/abc.jsp, I get error, 
  I have used tiles to create layout , I have two different roles for my app, one is user and second is admin, so obviously, I have created two dir under /WEB-INF/JSP/user and /WEB-INF/jsp/admin and put common files under /WEB-INF/jsp, so when I created a view (<strong>check tiles config in code</strong>) for user, I have used /WEB-INF/jsp/user, when access common files it works fine but when I submit a request to access files under /WEB-INF/jsp/user I got following error </p>
  
  <pre><code>HTTP Status 500 - Request processing failed; nested exception is org.apache.tiles.impl.CannotRenderException: ServletException including path '/WEB-INF/jsp/layout/user/layout.jsp'.
  
  type Exception report
  
  message Request processing failed; nested exception is org.apache.tiles.impl.CannotRenderException: ServletException including path '/WEB-INF/jsp/layout/user/layout.jsp'.
  
  description The server encountered an internal error that prevented it from fulfilling this request.
  
  exception
  
  org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.apache.tiles.impl.CannotRenderException: ServletException including path '/WEB-INF/jsp/layout/user/layout.jsp'.
  org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:656)
  org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:560)
  javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
  javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
  org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:393)
  </code></pre>
  
  <p>HERE IS LOG</p>
  
  <pre><code>SEVERE: Servlet.service() for servlet [mvc] in context with path [/docuSaver] threw exception [Request processing failed; nested exception is org.apache.tiles.impl.CannotRenderException: ServletException including path '/WEB-INF/jsp/layout/user/layout.jsp'.] with root cause
  org.apache.jasper.JasperException: /WEB-INF/jsp/layout/user/header.jsp (line: 21, column: 20) Attribute attribute invalid for tag insertAttribute according to TLD
  at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:42)
  at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:408)
  at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:237)
  at org.apache.jasper.compiler.Validator$ValidateVisitor.checkXmlAttributes(Validator.java:1265)
  at org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:875)
  at org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1539)
  at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2376)
  at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2428)
  at org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2434)
  at org.apache.jasper.compiler.Node$Root.accept(Node.java:475)
  at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2376)
  at org.apache.jasper.compiler.Validator.validateExDirectives(Validator.java:1795)
  at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:217)
  at org.apache.jasper.compiler.Compiler.compile(Compiler.java:373)
  at org.apache.jasper.compiler.Compiler.compile(Compiler.java:353)
  at org.apache.jasper.compiler.Compiler.compile(Compiler.java:340)
  at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:646)
  at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:357)
  at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
  at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
  at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:393)
  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
  at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:749)
  at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:605)
  at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:544)
  at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:954)
  at org.apache.jasper.runtime.PageContextImpl.doInclude(PageContextImpl.java:684)
  at org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java:678)
  at org.apache.tiles.jsp.context.JspTilesRequestContext.include(JspTilesRequestContext.java:103)
  at org.apache.tiles.jsp.context.JspTilesRequestContext.dispatch(JspTilesRequestContext.java:96)
  at org.apache.tiles.renderer.impl.TemplateAttributeRenderer.write(TemplateAttributeRenderer.java:44)
  at org.apache.tiles.renderer.impl.AbstractBaseAttributeRenderer.render(AbstractBaseAttributeRenderer.java:106)
  at org.apache.tiles.renderer.impl.ChainedDelegateAttributeRenderer.write(ChainedDelegateAttributeRenderer.java:76)
  at org.apache.tiles.renderer.impl.AbstractBaseAttributeRenderer.render(AbstractBaseAttributeRenderer.java:106)
  at org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:670)
  at org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:336)
  at org.apache.tiles.template.InsertAttributeModel.renderAttribute(InsertAttributeModel.java:210)
  at org.apache.tiles.template.InsertAttributeModel.end(InsertAttributeModel.java:126)
  at org.apache.tiles.jsp.taglib.InsertAttributeTag.doTag(InsertAttributeTag.java:311)
  at org.apache.jsp.WEB_002dINF.jsp.layout.user.layout_jsp._jspx_meth_tiles_005finsertAttribute_005f1(layout_jsp.java:145)
  at org.apache.jsp.WEB_002dINF.jsp.layout.user.layout_jsp._jspService(layout_jsp.java:78)
  at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
  at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
  at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
  at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
  at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:393)
  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
  at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:749)
  at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:487)
  at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:412)
  at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:339)
  at org.apache.tiles.servlet.context.ServletTilesRequestContext.forward(ServletTilesRequestContext.java:241)
  at org.apache.tiles.servlet.context.ServletTilesRequestContext.dispatch(ServletTilesRequestContext.java:222)
  at org.apache.tiles.renderer.impl.TemplateAttributeRenderer.write(TemplateAttributeRenderer.java:44)
  at org.apache.tiles.renderer.impl.AbstractBaseAttributeRenderer.render(AbstractBaseAttributeRenderer.java:106)
  at org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:670)
  at org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:690)
  at org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:644)
  at org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:627)
  at org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:321)
  at org.springframework.web.servlet.view.tiles2.TilesView.renderMergedOutputModel(TilesView.java:124)
  at org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:250)
  at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1031)
  at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:815)
  at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:717)
  at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644)
  at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:560)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
  at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:393)
  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
  at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
  at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
  at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
  at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
  at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
  at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:936)
  at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
  at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
  at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004)
  at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
  at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
  at java.lang.Thread.run(Thread.java:722)
  </code></pre>
  
  <p>Here is MY SPRING CONFIG</p>
  
  <pre><code>&lt;context:component-scan base-package="com.XXXX.common.controller" /&gt;
  &lt;mvc:annotation-driven /&gt;
  &lt;mvc:default-servlet-handler/&gt;
  &lt;bean
      class="org.springframework.web.servlet.view.UrlBasedViewResolver"&gt;
      &lt;property name="order" value="2" /&gt;
      &lt;property name="viewClass"&gt; 
          &lt;value&gt;org.springframework.web.servlet.view.tiles2.TilesView &lt;/value&gt;
      &lt;/property&gt;
  &lt;/bean&gt;
  &lt;bean id="tilesConfigurer"
        class="org.springframework.web.servlet.view.tiles2.TilesConfigurer"&gt;
      &lt;property name="definitions"&gt;
          &lt;list&gt;
              &lt;value&gt;/WEB-INF/**/tiles.xml&lt;/value&gt;
          &lt;/list&gt;
      &lt;/property&gt;
  &lt;/bean&gt; 
  &lt;bean
      class="org.springframework.web.servlet.view.InternalResourceViewResolver"&gt;
      &lt;property name="order" value="3" /&gt;
      &lt;property name="prefix"&gt;
          &lt;value&gt;/WEB-INF/jsp/&lt;/value&gt;
      &lt;/property&gt;
      &lt;property name="suffix"&gt;
          &lt;value&gt;.jsp&lt;/value&gt;
      &lt;/property&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>HERE IS TILES CONFIG</p>
  
  <pre><code>&lt;tiles-definitions&gt;
  &lt;definition name="userLayout" template="/WEB-INF/jsp/layout/user/layout.jsp"&gt;
      &lt;put-attribute name="title" value="" /&gt;
      &lt;put-attribute name="header" value="/WEB-INF/jsp/layout/user/header.jsp" /&gt;
      &lt;put-attribute name="menu" value="" /&gt;
      &lt;put-attribute name="body" value="" /&gt;
      &lt;put-attribute name="footer" value="/WEB-INF/jsp/layout/user/footer.jsp" /&gt;
  &lt;/definition&gt;
   &lt;definition name="userHome" extends="userLayout"&gt;
      &lt;put-attribute name="title" value="XXXX" /&gt;
      &lt;put-attribute name="menu" value="/WEB-INF/jsp/user/menu.jsp" /&gt;
      &lt;put-attribute name="body" value="/WEB-INF/jsp/user/body.jsp" /&gt;
  &lt;/definition&gt;
  &lt;/tiles-definitions&gt;
  </code></pre>
  
  <p>Here is my WEB XML CONFIG</p>
  
  <pre><code>&lt;servlet-mapping&gt;
  &lt;servlet-name&gt;jsp&lt;/servlet-name&gt;
  &lt;url-pattern&gt;/WEB-INF/jsp/layout/user/*&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
   &lt;servlet-mapping&gt;
    &lt;servlet-name&gt;jsp&lt;/servlet-name&gt;
    &lt;url-pattern&gt;/WEB-INF/jsp/*&lt;/url-pattern&gt;
   &lt;/servlet-mapping&gt;
    &lt;servlet-mapping&gt;
    &lt;servlet-name&gt;jsp&lt;/servlet-name&gt;
    &lt;url-pattern&gt;/WEB-INF/jsp/user/*&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
   &lt;servlet-mapping&gt;
   &lt;servlet-name&gt;jsp&lt;/servlet-name&gt;
   &lt;url-pattern&gt;/WEB-INF/*&lt;/url-pattern&gt;
   &lt;/servlet-mapping&gt;
  &lt;servlet&gt;
  &lt;servlet-name&gt;jsp&lt;/servlet-name&gt;
  &lt;servlet-class&gt;org.apache.jasper.servlet.JspServlet&lt;/servlet-class&gt;
  &lt;/servlet&gt;
  &lt;servlet&gt;
      &lt;servlet-name&gt;mvc&lt;/servlet-name&gt;
      &lt;servlet-class&gt;org.springframework.web.servlet.DispatcherServlet&lt;/servlet-class&gt;
      &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
  &lt;/servlet&gt;
  
  &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;mvc&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  
  &lt;context-param&gt;
      &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;
      &lt;param-value&gt;/WEB-INF/mvc-servlet.xml&lt;/param-value&gt;
  &lt;/context-param&gt;
  
  &lt;listener&gt;
      &lt;listener-class&gt;org.springframework.web.context.ContextLoaderListener&lt;/listener-class&gt;
  &lt;/listener&gt;
  </code></pre>
  
  <p>HERE IS MY JSP PAGE</p>
  
  <pre><code>&lt;%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles"%&gt;
  
  &lt;html&gt;
        &lt;head&gt;
      &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"&gt;
      &lt;title&gt;&lt;tiles:insertAttribute name="title" ignore="true" /&gt;&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;table border="1" cellpadding="2" cellspacing="2" align="center"&gt;
          &lt;tr&gt;
              &lt;td height="30"&gt;&lt;tiles:insertAttribute name="header" /&gt;
              &lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td height="250"&gt;&lt;tiles:insertAttribute name="menu" /&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;&lt;tiles:insertAttribute name="body" /&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td height="30"&gt;&lt;tiles:insertAttribute name="footer" /&gt;
              &lt;/td&gt;
          &lt;/tr&gt;
          &lt;/table&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>So, when I try to use the userLayout, it gives me status 500 exeception, It seems, I can only put my jsp pages under /WEB-INF/jsp directory as it is configured in spring at internalViewResolver, because when I created a layout in tiles with all jsp pages under /WEB-INF/jsp , it runs successfully, but when I created a folder and /WEB-INF/jsp/folderName/jspPAGE.jsp, spring start creating problem and it seems spring framework is fighting for finding out deeper path like /WEB-INF/jsp/folder/...
  So, can some one tell me how to enable spring to find out more path inside the specified path,
  Also I have a configuration for JSON and XML in spring config which I have not mentioned for simply reduce the code amount</p>