wrkbrs

[Spring] 타일즈 에러(tiles Exception) - org.apache.tiles.template.NoSuchAttributeException: Attribute 'left' not found. 본문

Spring

[Spring] 타일즈 에러(tiles Exception) - org.apache.tiles.template.NoSuchAttributeException: Attribute 'left' not found.

zcarc 2019. 7. 19. 04:01

 

template.jsp는 아래와 같이 정의되어 있고 left를 필요로 한다.

    <tiles:insertAttribute name="header" />
    <div id="container">
    	<tiles:insertAttribute name="left" />
       <tiles:insertAttribute name="body" />
    </div>
    <tiles:insertAttribute name="footer" />

 

하지만 tiles.xml 는 아래와 같이 정의되어 있어 left를 찾을 수 없다는 예외이다.

    <definition name="base" template="/WEB-INF/views/layout/template.jsp">
        <put-attribute name="nav"   value="/WEB-INF/views/layout/nav.jsp" />
        <put-attribute name="header" value="/WEB-INF/views/layout/header.jsp" />
        
        <put-attribute name="footer" value="/WEB-INF/views/layout/footer.jsp" />
    </definition>

 

 

 

 

 

HTTP Status 500 – Internal Server Error


Type Exception Report

Message Request processing failed; nested exception is org.apache.tiles.request.render.CannotRenderException: ServletException including path '/WEB-INF/views/layout/template.jsp'.

Description The server encountered an unexpected condition that prevented it from fulfilling the request.

Exception

org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.apache.tiles.request.render.CannotRenderException: ServletException including path '/WEB-INF/views/layout/template.jsp'. org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:982) org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:861) javax.servlet.http.HttpServlet.service(HttpServlet.java:635) org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846) javax.servlet.http.HttpServlet.service(HttpServlet.java:742) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

Root Cause

org.apache.tiles.request.render.CannotRenderException: ServletException including path '/WEB-INF/views/layout/template.jsp'. org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:399) org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:238) org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:221) org.apache.tiles.renderer.DefinitionRenderer.render(DefinitionRenderer.java:59) org.springframework.web.servlet.view.tiles3.TilesView.renderMergedOutputModel(TilesView.java:132) org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:303) org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1286) org.springframework.web.servlet.DispatcherServlet.processDispatchResult(DispatcherServlet.java:1041) org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:984) org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:901) org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970) org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:861) javax.servlet.http.HttpServlet.service(HttpServlet.java:635) org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846) javax.servlet.http.HttpServlet.service(HttpServlet.java:742) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

Root Cause

java.io.IOException: ServletException including path '/WEB-INF/views/layout/template.jsp'. org.apache.tiles.request.servlet.ServletUtil.wrapServletException(ServletUtil.java:61) org.apache.tiles.request.servlet.ServletRequest.forward(ServletRequest.java:267) org.apache.tiles.request.servlet.ServletRequest.doForward(ServletRequest.java:228) org.apache.tiles.request.AbstractClientRequest.dispatch(AbstractClientRequest.java:57) org.apache.tiles.request.render.DispatchRenderer.render(DispatchRenderer.java:47) org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:259) org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:397) org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:238) org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:221) org.apache.tiles.renderer.DefinitionRenderer.render(DefinitionRenderer.java:59) org.springframework.web.servlet.view.tiles3.TilesView.renderMergedOutputModel(TilesView.java:132) org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:303) org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1286) org.springframework.web.servlet.DispatcherServlet.processDispatchResult(DispatcherServlet.java:1041) org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:984) org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:901) org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970) org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:861) javax.servlet.http.HttpServlet.service(HttpServlet.java:635) org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846) javax.servlet.http.HttpServlet.service(HttpServlet.java:742) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

Root Cause

org.apache.tiles.template.NoSuchAttributeException: Attribute 'left' not found. org.apache.tiles.template.DefaultAttributeResolver.computeAttribute(DefaultAttributeResolver.java:50) org.apache.tiles.template.InsertAttributeModel.resolveAttribute(InsertAttributeModel.java:165) org.apache.tiles.template.InsertAttributeModel.execute(InsertAttributeModel.java:121) org.apache.tiles.jsp.taglib.InsertAttributeTag.doTag(InsertAttributeTag.java:299) org.apache.jsp.WEB_002dINF.views.layout.template_jsp._jspx_meth_tiles_005finsertAttribute_005f1(template_jsp.java:190) org.apache.jsp.WEB_002dINF.views.layout.template_jsp._jspService(template_jsp.java:128) org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) javax.servlet.http.HttpServlet.service(HttpServlet.java:742) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:457) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:386) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:330) javax.servlet.http.HttpServlet.service(HttpServlet.java:742) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) org.apache.tiles.request.servlet.ServletRequest.forward(ServletRequest.java:265) org.apache.tiles.request.servlet.ServletRequest.doForward(ServletRequest.java:228) org.apache.tiles.request.AbstractClientRequest.dispatch(AbstractClientRequest.java:57) org.apache.tiles.request.render.DispatchRenderer.render(DispatchRenderer.java:47) org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:259) org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:397) org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:238) org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:221) org.apache.tiles.renderer.DefinitionRenderer.render(DefinitionRenderer.java:59) org.springframework.web.servlet.view.tiles3.TilesView.renderMergedOutputModel(TilesView.java:132) org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:303) org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1286) org.springframework.web.servlet.DispatcherServlet.processDispatchResult(DispatcherServlet.java:1041) org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:984) org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:901) org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970) org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:861) javax.servlet.http.HttpServlet.service(HttpServlet.java:635) org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846) javax.servlet.http.HttpServlet.service(HttpServlet.java:742) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

Note The full stack trace of the root cause is available in the server logs.