Skip to content

Commit

Permalink
WW-4044 Solves problem with infinitive loop when used with <s:action/…
Browse files Browse the repository at this point in the history
…> 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
  • Loading branch information
lukaszlenart committed Oct 29, 2013
1 parent 9b3f98e commit 9cab14b
Showing 1 changed file with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,23 @@ public TilesResult(String location) {

@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;
}

}

0 comments on commit 9cab14b

Please sign in to comment.