java - Cannot render an attribute that is not a string, toString returns: null ERROR in SPRING MVC -
i trying create generic error handler spring mvc project following tutorial: http://www.mkyong.com/spring-mvc/spring-mvc-exceptionhandler-example/
but in project, using tiles-defs , getting error when access error page in browser:
org.apache.tiles.request.render.cannotrenderexception: cannot render attribute not string, tostring returns: null @ org.apache.tiles.impl.basictilescontainer.render(basictilescontainer.java:255) @ 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:114) @ org.springframework.web.servlet.view.abstractview.render(abstractview.java:267) @ org.springframework.web.servlet.dispatcherservlet.render(dispatcherservlet.java:1217) @ org.springframework.web.servlet.dispatcherservlet.processdispatchresult(dispatcherservlet.java:1005) @ org.springframework.web.servlet.dispatcherservlet.dodispatch(dispatcherservlet.java:952) @ org.springframework.web.servlet.dispatcherservlet.doservice(dispatcherservlet.java:870) @ org.springframework.web.servlet.frameworkservlet.processrequest(frameworkservlet.java:961) @ org.springframework.web.servlet.frameworkservlet.doget(frameworkservlet.java:852) @ javax.servlet.http.httpservlet.service(httpservlet.java:621) @ org.springframework.web.servlet.frameworkservlet.service(frameworkservlet.java:837) @ javax.servlet.http.httpservlet.service(httpservlet.java:728) @ org.apache.catalina.core.applicationfilterchain.internaldofilter(applicationfilterchain.java:305) @ org.apache.catalina.core.applicationfilterchain.dofilter(applicationfilterchain.java:210) @ org.apache.tomcat.websocket.server.wsfilter.dofilter(wsfilter.java:51) @ org.apache.catalina.core.applicationfilterchain.internaldofilter(applicationfilterchain.java:243) @ org.apache.catalina.core.applicationfilterchain.dofilter(applicationfilterchain.java:210)
here tiles-defs configuration:
<definition name="/error/generic_error"> <put-attribute name="body" value="/web-inf/views/error/generic_error.jsp" /> <put-attribute name="browsertitle" value="error screen" /> </definition>
i can't find cause nor solution problem appreciated.
you need add base template in tiles definition. should either extend template or must mention path attrib @ defintion <definition name="/error/generic_error" path= "{your-path}">
Comments
Post a Comment