WW-4606 made @TilesDefinition work with tiles 2

This commit is contained in:
cnenning
2016-02-03 14:18:54 +01:00
parent 8a9e01727c
commit 87979d2821
2 changed files with 7 additions and 2 deletions
@@ -20,6 +20,11 @@
<result type="tiles">showcase.freemarkerLayout</result>
</action>
<action name="tiles-annotations" class="org.apache.struts2.showcase.tiles.TilesAnnotationsAction">
<!-- note: this is not necessary when using convention-plugin -->
<result type="tiles"></result>
</action>
<action name="sanity">
<result type="redirect">/WEB-INF/tiles/layout.jsp</result>
<result type="redirect" name="success">/tiles/layout.jsp</result>
@@ -130,7 +130,7 @@ public class TilesResult extends ServletDispatcherResult {
boolean definitionValid = false;
try {
LOG.debug("checking if tiles definition exists '{}'", location);
definitionValid = container.isValidDefinition(location, request);
definitionValid = container.isValidDefinition(location, request, response);
} catch (TilesException e) {
LOG.warn("got TilesException while checking if definiton exists, ignoring it", e);
}
@@ -143,7 +143,7 @@ public class TilesResult extends ServletDispatcherResult {
Definition definition = annotationProcessor.buildTilesDefinition(location, tilesDefinition);
if (container instanceof MutableTilesContainer) {
LOG.debug("registering tiles definition with name '{}'", definition.getName());
((MutableTilesContainer)container).register(definition, request);
((MutableTilesContainer)container).register(definition, request, response);
} else {
LOG.error("cannot register tiles definition as tiles container is not mutable!");
}