tiles-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Venu Gopalan <venugopala...@yahoo.com.INVALID>
Subject Re: Struts 1 / Tile 2 integration issue
Date Fri, 17 Mar 2017 16:07:50 GMT
Thank you... I was not getting the servlet context. I added the below line in the web.xml
and the null pointer is gone.    <servlet>   <servlet-name>title</servlet-name>  
<servlet-class>org.apache.tiles.web.startup.TilesServlet </servlet-class>  
<load-on-startup>1</load-on-startup>      </servlet>
But Now am getting :org.apache.tiles.template.NoSuchAttributeException: Attribute '/baseLayout.jsp'
not found.
	at org.apache.tiles.template.DefaultAttributeResolver.computeAttribute(DefaultAttributeResolver.java:49)
below is the tiles-defs.xml    <definition name="baseLayout" template="/baseLayout.jsp">
        <put-attribute name="title"  value="Tiles Example" />
        <put-attribute name="header" value="/header.jsp" />
        <put-attribute name="menu"   value="/menu.jsp" />
        <put-attribute name="body"   value="/body.jsp" />
        <put-attribute name="footer" value="/footer.jsp" />        
    </definition>
    <definition name="friends" extends="baseLayout">
        <put-attribute name="title" value="Friends" />
        <put-attribute name="body" value="/friends.jsp" />
    </definition>
    <definition name="office" extends="baseLayout">
        <put-attribute name="title" value="The Office" />
        <put-attribute name="body" value="/office.jsp" />
    </definition>
Below is the index.jsp<tiles:insertAttribute name="/baseLayout.jsp" flush="true">
    <tiles:putAttribute name="title" value="Tiles Example"/>
    <tiles:putAttribute name="header" value="/header.jsp" />
    <tiles:putAttribute name="menu" value="/menu.jsp" />
    <tiles:putAttribute name="body" value="/body.jsp" />
    <tiles:putAttribute name="footer" value="/footer.jsp" />
</tiles:insertAttribute>

Still debugging.
 

    On Friday, 17 March 2017 11:25 AM, Torsten Krah <krah.tm@gmail.com> wrote:
 

 I know the line where its failing - were in the stacktrace.

The question is why the container got null.

If you have a look at the other classes in the trace which are called
before it should never reach the stack that deep but fail before with an
error like there is no container.
To me this look like you're overall setup is missing to correctly setup
the TilesContainer with the ServletContext.

Take a debugger and have a look why it would not fail on the first
invocations of those tiles tags which checks for a non null container
and who might remove it.

kind regards




   
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message