tiles-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aditya Saraf <adi.sa...@gmail.com>
Subject Null Container returned by getContainer
Date Fri, 12 Aug 2011 13:16:49 GMT
Hi,

I am trying to get the tiles definitions to work within folder. They seem to
be working on all root level files, but not inside folders. I am using the
BasicTilesContainer configuration with a tiles.xml file in the WEB-INF
folder. My error is as follows.

java.lang.NullPointerException
org.apache.tiles.template.InsertDefinitionModel.start(InsertDefinitionModel.java:74)
org.apache.tiles.jsp.taglib.InsertDefinitionTag.doTag(InsertDefinitionTag.java:276)

After attaching the source, I see that the line 217 in
org.apache.tiles.jsp.context.JspUtil.java calls getContainer(). Which in
turn calls an overloaded method of getContainer() on line 127 in the same
class. On line 127, I notice the following.

(TilesContainer) context.getAttribute(key,PageContext.*APPLICATION_SCOPE*);

I am suspecting that key is not being set or the attribute cannot be
retrieved given the appropriate key. They key should be set to
TilesAccess.CONTAINER_ATTRIBUTE. I guess someting in my Tomcat context is
not configured properly for this to not return the proper Tiles Container.
My web.xml looks like this

<servlet-name>tiles</servlet-name>
  <servlet-class>org.apache.tiles.web.startup.TilesServlet</servlet-class>
     <init-param>
         <param-name>
           org.apache.tiles.impl.BasicTilesContainer.DEFINITIONS_CONFIG
         </param-name>
         <param-value>
           /WEB-INF/tiles.xml
         </param-value>
     </init-param>
     <load-on-startup>2</load-on-startup>
 </servlet>

Do I need to specify some sort of a context param for the container to be
initialized and returned correctly? Please let me know.


Thanks,
Adi Saraf

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