WW-4044 Solves problem with infinitive loop when used with <s:action/> tag and attribute executeResult is set to "true"

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1536598 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Lukasz Lenart
2013-10-29 07:01:49 +00:00
parent 9b3f98e572
commit 9cab14bcf7
@@ -59,16 +59,23 @@ public class TilesResult extends ServletDispatcherResult {
@Override
public void doExecute(String location, ActionInvocation invocation) throws Exception {
setLocation(location);
ServletContext context = ServletActionContext.getServletContext();
ApplicationContext applicationContext = ServletUtil.getApplicationContext(context);
TilesContainer container = TilesAccess.getContainer(applicationContext);
HttpServletRequest request = ServletActionContext.getRequest();
HttpServletResponse response = ServletActionContext.getResponse();
ApplicationContext applicationContext = ServletUtil.getApplicationContext(context);
ServletRequest servletRequest = new ServletRequest(applicationContext, request, response);
TilesContainer container = initTilesContainer(applicationContext, servletRequest);
container.startContext(servletRequest);
container.render(location, servletRequest);
}
protected TilesContainer initTilesContainer(ApplicationContext applicationContext, ServletRequest servletRequest) {
TilesContainer container = TilesAccess.getContainer(applicationContext);
TilesAccess.setCurrentContainer(servletRequest, container);
return container;
}
}