mirror of
https://github.com/apache/struts.git
synced 2026-08-06 23:27:07 +00:00
WW-4606 made @TilesDefinition work with tiles 2
This commit is contained in:
@@ -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!");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user