The most ccommon exception when using Tiles in a Struts application is theJasper Exception. For example look into the exception below.

javax.servlet.ServletException: Can't get definitions factory from context

This exception can occur if the Tiles Servlet entries are wrong. We can easily solve the exception by modifying the Tiles servlet with the correct entries.

Example:

<servlet>

<servlet-name>TilesServlet</servlet-name>

<servlet-class>org.apache.struts.tiles.TilesServlet</servlet-class>

<init-param>

<param-name>definitions-config</param-name>

<param-value>/WEB-INF/tiles-defs.xml</param-value>

</init-param>

<init-param>

<param-name>definitions-parser-validate</param-name>

<param-value>true</param-value>

</init-param>

<load-on-startup>2</load-on-startup>

</servlet>


Like it on Facebook, Tweet it or share this article on other bookmarking websites.

No comments