I am trying to integrate Spring 3 and Tiles 3, I am viewing the page fine and application is working fine but its giving me following error.
javax.servlet.ServletException: File "/WEB-INF/template/WEB-INF/template/layout.jsp" not found
Here are my configuration files.
<bean class="org.springframework.web.servlet.view.tiles3.TilesViewResolver">
<property name="viewClass"
value="org.springframework.web.servlet.view.tiles3.TilesView"></property>
<property name="order" value="0"></property>
</bean>
<bean class="org.springframework.web.servlet.view.tiles3.TilesConfigurer"
id="tilesConfigurer">
<property name="definitions" value="/WEB-INF/tiles.xml"></property>
</bean>
<bean id="messageSource"
class="org.springframework.context.support.ReloadableResourceBundleMessageSource">
<property name="basename" value="classpath:I18N/messages" />
<property name="defaultEncoding" value="UTF-8" />
</bean>
<bean id="localeResolver"
class="org.springframework.web.servlet.i18n.CookieLocaleResolver">
<property name="defaultLocale" value="en" />
</bean>
<mvc:interceptors>
<mvc:interceptor>
<mvc:mapping path="/" />
<bean class="org.springframework.web.servlet.i18n.LocaleChangeInterceptor">
<property name="paramName" value="lang"></property>
</bean>
</mvc:interceptor>
</mvc:interceptors>
this is my tiles.xml
<tiles-definitions>
<definition name="base.definition"
template='WEB-INF/template/layout.jsp'>
<put-attribute name="title" value="" />
<put-attribute name="header" value="/WEB-INF/tile/header.jsp" />
<put-attribute name="body" value="" />
<put-attribute name="footer" value="/WEB-INF/tile/footer.jsp" />
</definition>
<definition name="login" extends="base.definition">
<put-attribute name="title" value="login" />
<put-attribute name="body" value="/WEB-INF/tile/login.jsp" />
</definition>
here is my layout.jsp
<body bgcolor="">
<table border="1" cellpadding="2" cellspacing="2" align="center">
<tr>
<td height="20%" colspan="1"><tiles:insertAttribute
name="header" /></td>
</tr>
<tr>
<td width="350"><tiles:insertAttribute name="body" /></td>
</tr>
<tr>
<td height="10%" colspan="1"><tiles:insertAttribute
name="footer" /></td>
</tr>
</table>
What am I doing wrong here? I spent hours on it, still cant figure it out.
Look at exception:
Tiles tries to find "layout.js" at /WEB-INF/template/WEB-INF/template.
In
Try to add "/" before template path: