WW-4606 made @TilesDefinition work with tiles 2
Project: http://git-wip-us.apache.org/repos/asf/struts/repo Commit: http://git-wip-us.apache.org/repos/asf/struts/commit/87979d28 Tree: http://git-wip-us.apache.org/repos/asf/struts/tree/87979d28 Diff: http://git-wip-us.apache.org/repos/asf/struts/diff/87979d28 Branch: refs/heads/support-2-3 Commit: 87979d282126bfe37ba6993b538310e1ae124e1c Parents: 8a9e017 Author: cnenning <cnenn...@apache.org> Authored: Wed Feb 3 14:18:54 2016 +0100 Committer: cnenning <cnenn...@apache.org> Committed: Wed Feb 3 14:18:54 2016 +0100 ---------------------------------------------------------------------- apps/showcase/src/main/resources/struts-tiles.xml | 5 +++++ .../main/java/org/apache/struts2/views/tiles/TilesResult.java | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/struts/blob/87979d28/apps/showcase/src/main/resources/struts-tiles.xml ---------------------------------------------------------------------- diff --git a/apps/showcase/src/main/resources/struts-tiles.xml b/apps/showcase/src/main/resources/struts-tiles.xml index 9fbe025..3d30911 100644 --- a/apps/showcase/src/main/resources/struts-tiles.xml +++ b/apps/showcase/src/main/resources/struts-tiles.xml @@ -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> http://git-wip-us.apache.org/repos/asf/struts/blob/87979d28/plugins/tiles/src/main/java/org/apache/struts2/views/tiles/TilesResult.java ---------------------------------------------------------------------- diff --git a/plugins/tiles/src/main/java/org/apache/struts2/views/tiles/TilesResult.java b/plugins/tiles/src/main/java/org/apache/struts2/views/tiles/TilesResult.java index c1dbfb9..e2a7dc7 100644 --- a/plugins/tiles/src/main/java/org/apache/struts2/views/tiles/TilesResult.java +++ b/plugins/tiles/src/main/java/org/apache/struts2/views/tiles/TilesResult.java @@ -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!"); }