Announcement Announcement Module
Collapse
No announcement yet.
Spring 3-Tiles 2.2.1 Problem: org.springframework.web.util.NestedServletExceptio n Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring 3-Tiles 2.2.1 Problem: org.springframework.web.util.NestedServletExceptio n

    Hello all,

    I wrote a MVC application with Spring3 successfully. But unfortunately, when i tried to entegrate tiles to my jsp views, i 'm getting following exception. I followed the instructions in this web site for tiles entegration: http://viralpatel.net/blogs/2010/07/...e-eclipse.html

    Please, i need a advise. Why is it so hard ?

    EXCEPTION:

    org.springframework.web.util.NestedServletExceptio n: Request processing failed; nested exception is org.apache.tiles.impl.CannotRenderException: ServletException including path '/WEB-INF/tiles/layout.jsp'.
    org.springframework.web.servlet.FrameworkServlet.p rocessRequest(FrameworkServlet.java:681)
    org.springframework.web.servlet.FrameworkServlet.d oGet(FrameworkServlet.java:574)
    javax.servlet.http.HttpServlet.service(HttpServlet .java:617)
    javax.servlet.http.HttpServlet.service(HttpServlet .java:717)
    root cause

    org.apache.tiles.impl.CannotRenderException: ServletException including path '/WEB-INF/tiles/layout.jsp'.
    org.apache.tiles.impl.BasicTilesContainer.render(B asicTilesContainer.java:692)
    org.apache.tiles.impl.BasicTilesContainer.render(B asicTilesContainer.java:644)
    org.apache.tiles.impl.BasicTilesContainer.render(B asicTilesContainer.java:627)
    org.apache.tiles.impl.BasicTilesContainer.render(B asicTilesContainer.java:321)
    org.springframework.web.servlet.view.tiles2.TilesV iew.renderMergedOutputModel(TilesView.java:124)
    org.springframework.web.servlet.view.AbstractView. render(AbstractView.java:250)
    org.springframework.web.servlet.DispatcherServlet. render(DispatcherServlet.java:1047)
    org.springframework.web.servlet.DispatcherServlet. doDispatch(DispatcherServlet.java:817)
    org.springframework.web.servlet.DispatcherServlet. doService(DispatcherServlet.java:719)
    org.springframework.web.servlet.FrameworkServlet.p rocessRequest(FrameworkServlet.java:669)
    org.springframework.web.servlet.FrameworkServlet.d oGet(FrameworkServlet.java:574)
    javax.servlet.http.HttpServlet.service(HttpServlet .java:617)
    javax.servlet.http.HttpServlet.service(HttpServlet .java:717)
    root cause

    org.apache.tiles.util.TilesIOException: ServletException including path '/WEB-INF/tiles/layout.jsp'.

    Best Regards...

  • #2
    My tiles-defs.xml :
    Code:
    ..
    <tiles-definitions>
    
    	<definition name="base.definition"
    		template="/WEB-INF/tiles/layout.jsp">
    		<put-attribute name="title" value="" />
    		<put-attribute name="header" value="/WEB-INF/tiles/header.jsp" />
    		<put-attribute name="menu" value="/WEB-INF/tiles/menu.jsp" />
    		<put-attribute name="body" value="" />
    		<put-attribute name="footer" value="/WEB-INF/tiles/footer.jsp" />
    	</definition>
    	
    	
    	<definition name="hello" extends="base.definition">
    		<put-attribute name="title" value="hello" />
    		<put-attribute name="body" value="/WEB-INF/jsp/hello.jsp" />
    	</definition>
    
    </tiles-definitions>
    Last edited by eaglesinblack; Oct 4th, 2011, 07:02 AM.

    Comment


    • #3
      My *-servlet.xml :

      Code:
      ...
      ...
      	<!--  TILES -->
      	<bean id="resourceViewResolver"
      	    class="org.springframework.web.servlet.view.UrlBasedViewResolver">
      	    <property name="viewClass">
      	        <value>
      	            org.springframework.web.servlet.view.tiles2.TilesView
      	        </value>
      	    </property>
      	</bean>
      	
      	<bean id="tilesConfigurer"
      	    class="org.springframework.web.servlet.view.tiles2.TilesConfigurer">
      	    <property name="definitions">
      	        <list>
      	            <value>/WEB-INF/tiles-defs.xml</value>
      	        </list>
      	    </property>
      	</bean>
      Last edited by eaglesinblack; Oct 4th, 2011, 07:02 AM.

      Comment


      • #4
        My layout.jsp :

        Code:
        <%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles"%>
        <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
        "http://www.w3.org/TR/html4/loose.dtd">
        <html>
        <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title><tiles:insertAttribute name="title" ignore="true" /></title>
        </head>
        <body>
        <table border="1" cellpadding="2" cellspacing="2" align="center">
        	<tr>
        		<td height="30" colspan="2"><tiles:insertAttribute name="header" />
        		</td>
        	</tr>
        	<tr>
        		<td height="250"><tiles:insertAttribute name="menu" /></td>
        		<td width="350"><tiles:insertAttribute name="body" /></td>
        	</tr>
        	<tr>
        		<td height="30" colspan="2"><tiles:insertAttribute name="footer" />
        		</td>
        	</tr>
        </table>
        </body>
        </html>
        Last edited by eaglesinblack; Oct 4th, 2011, 07:01 AM.

        Comment


        • #5
          Please use [ code][/code ] tags when posting code, that way it remains readable.

          Judging from your stack trace either your layout.jsp isn't in the location where you specified it should be or there is an error in your layout.jsp (like not able to find the tag library etc.).

          Comment


          • #6
            Thank you for your quick reply and suggestion, Marten Deinum.

            When i edited the tiles-defs.xml like following (instead of /WEB-INF/tiles/layout.jsp, now i am using WEB-INF/tiles/layout.jsp ), i can see the layout.

            Code:
            <tiles-definitions>
            
            		<definition name="base.definition"
            		template="WEB-INF/tiles/layout.jsp">
            		<put-attribute name="title" value="" />
            		<put-attribute name="header" value="/WEB-INF/tiles/header.jsp" />
            		<put-attribute name="menu" value="/WEB-INF/tiles/menu.jsp" />
            		<put-attribute name="body" value="" />
            		<put-attribute name="footer" value="/WEB-INF/tiles/footer.jsp" />
            	</definition>
            	
            	
            	<definition name="hello" extends="base.definition">
            		<put-attribute name="title" value="hello" />
            		<put-attribute name="body" value="/WEB-INF/jsp/hello.jsp" />
            	</definition>
            
            	<definition name="subscriberDetail" extends="base.definition">
            		<put-attribute name="title" value="subscriberDetail" />
            		<put-attribute name="body" value="/WEB-INF/jsp/subscriberDetail.jsp" />
            	</definition>
            
            </tiles-definitions>
            Last edited by eaglesinblack; Oct 4th, 2011, 08:16 AM.

            Comment


            • #7
              Originally posted by eaglesinblack View Post
              Thank you for your quick reply and suggestion, Marten Deinum.

              When i edited the tiles-defs.xml like following (instead of /WEB-INF/tiles/layout.jsp, now i am using WEB-INF/tiles/layout.jsp ), i can see the layout.

              Code:
              <tiles-definitions>
              
              		<definition name="base.definition"
              		template="WEB-INF/tiles/layout.jsp">
              		<put-attribute name="title" value="" />
              		<put-attribute name="header" value="/WEB-INF/tiles/header.jsp" />
              		<put-attribute name="menu" value="/WEB-INF/tiles/menu.jsp" />
              		<put-attribute name="body" value="" />
              		<put-attribute name="footer" value="/WEB-INF/tiles/footer.jsp" />
              	</definition>
              	
              	
              	<definition name="hello" extends="base.definition">
              		<put-attribute name="title" value="hello" />
              		<put-attribute name="body" value="/WEB-INF/jsp/hello.jsp" />
              	</definition>
              
              	<definition name="subscriberDetail" extends="base.definition">
              		<put-attribute name="title" value="subscriberDetail" />
              		<put-attribute name="body" value="/WEB-INF/jsp/subscriberDetail.jsp" />
              	</definition>
              
              </tiles-definitions>
              Thanks. I was also facing same problem, but when I removed "/" from tiles.xml then my application started working.

              Comment


              • #8
                Great it worked thanks for sharing the solution. It saved my time

                Originally posted by eaglesinblack View Post
                Thank you for your quick reply and suggestion, Marten Deinum.

                When i edited the tiles-defs.xml like following (instead of /WEB-INF/tiles/layout.jsp, now i am using WEB-INF/tiles/layout.jsp ), i can see the layout.

                Code:
                <tiles-definitions>
                
                		<definition name="base.definition"
                		template="WEB-INF/tiles/layout.jsp">
                		<put-attribute name="title" value="" />
                		<put-attribute name="header" value="/WEB-INF/tiles/header.jsp" />
                		<put-attribute name="menu" value="/WEB-INF/tiles/menu.jsp" />
                		<put-attribute name="body" value="" />
                		<put-attribute name="footer" value="/WEB-INF/tiles/footer.jsp" />
                	</definition>
                	
                	
                	<definition name="hello" extends="base.definition">
                		<put-attribute name="title" value="hello" />
                		<put-attribute name="body" value="/WEB-INF/jsp/hello.jsp" />
                	</definition>
                
                	<definition name="subscriberDetail" extends="base.definition">
                		<put-attribute name="title" value="subscriberDetail" />
                		<put-attribute name="body" value="/WEB-INF/jsp/subscriberDetail.jsp" />
                	</definition>
                
                </tiles-definitions>
                Great it worked thanks for sharing the solution. It saved my time

                Comment

                Working...
                X