Announcement Announcement Module
Collapse
No announcement yet.
Problem integrating tiles in Spring webapp Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Problem integrating tiles in Spring webapp

    Apologies if this has been answered before but I've been struggling with this problem for a while now.

    I'm attempting to implement tiles in my webapp.

    I have a tiles configurer and view resolver as follows:
    Code:
    <bean id="tilesConfigurer" class="org.springframework.web.servlet.view.tiles2.TilesConfigurer">
        <property name="definitions">
            <list>
                <value>/WEB-INF/conf/core/tiles-defs.xml</value>                
            </list>
        </property>
    </bean>  
    
    <bean id="viewResolver" class="org.springframework.web.servlet.view.UrlBasedViewResolver" >
        <property name="viewClass" value="org.springframework.web.servlet.view.tiles2.TilesView" />         
    </bean>
    My controller seems to return the view name as expected (e.g. "hello" for /hello.html), and my tiles are defined as follows:

    Code:
    <definition name="template" template="/WEB-INF/layouts/default/core/template.jsp">
        <put-attribute name="header" value="/WEB-INF/layouts/default/core/header.jsp"/>
        <put-attribute name="body" value="/WEB-INF/layouts/default/core/empty.jsp" />
        <put-attribute name="footer" value="/WEB-INF/layouts/default/core/footer.jsp" />
    </definition>
    
    <definition name="hello" extends="template" >
        <put-attribute name="body" value="/WEB-INF/jsp/hello.jsp" />
    </definition>
    However, when loading the page I get the following exception (I've shortened the output to fit in the post), any idea what's causing it?

    Code:
    SEVERE: Servlet.service() for servlet jsp threw exception 
    java.lang.NullPointerException
    at org.apache.struts.tiles.taglib.InsertTag.processAttribute(InsertTag.java:690)
    at org.apache.struts.tiles.taglib.InsertTag.createTagHandler(InsertTag.java:481)
    at org.apache.struts.tiles.taglib.InsertTag.doStartTag(InsertTag.java:441)
    at org.apache.jsp.WEB_002dINF.layouts.default_.core.template_jsp._jspx_meth_tiles_005finsert_005f0(template_jsp.java:138)
    
    ......
    
    SEVERE: Servlet.service() for servlet [dispatcher] in context with path  [/CustomerWebapp] threw exception [Request processing failed; nested exception is  org.apache.tiles.impl.CannotRenderException: ServletException including path '/WEB- INF/layouts/default/core/template.jsp'.] with root cause
    java.lang.NullPointerException
    at org.apache.struts.tiles.taglib.InsertTag.processAttribute(InsertTag.java:690)
    at org.apache.struts.tiles.taglib.InsertTag.createTagHandler(InsertTag.java:481)
    at org.apache.struts.tiles.taglib.InsertTag.doStartTag(InsertTag.java:441)
    at org.apache.jsp.WEB_002dINF.layouts.default_.core.template_jsp._jspx_meth_tiles_005finsert_005f0(template_jsp.java:138)
    at org.apache.jsp.WEB_002dINF.layouts.default_.core.template_jsp._jspService(template_jsp.java:92)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
    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:722)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:690)
    at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:477)
    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:402)
    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:329)
    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:262)
    at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1180)
    at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:950)
    at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:852)
    at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882)
    at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:778)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:225)
    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:168)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
    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:1001)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:585)
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:662)

  • #2
    Nevermind, found a problem with my tag libraries.

    Comment

    Working...
    X