Details
-
Bug
-
Status: Closed
-
Blocker
-
Resolution: Fixed
-
4.0.3, 4.1.0
-
None
-
None
-
0
-
Platform Sprint 142, Platform Sprint 143
Description
Reproduction path:
- create an archetype project
- add a custom component which redirects to the homepage, for example
public class RedirectComponent extends CommonComponent { @Override public void doBeforeRender(final HstRequest request, final HstResponse response) { super.doBeforeRender(request, response); Map<String, String[]> queryParams = new HashMap<>(); queryParams.put("noresults", new String[]{"true"}); sendRedirect(request.getRequestContext().getResolvedMount().getMount().getHomePage(), request, response, queryParams); } }
- configure the component class on some page and link a sitemap called redirect on it
- browse the site on http://localhost:8080/site/redirect
The result is that the page is broken and the following warning will be logged:
[INFO] [talledLocalContainer] 04.11.2016 14:46:07 WARN http-nio-8080-exec-1 [AggregationValve.invoke:227] Exception during sendRedirect. java.lang.IllegalStateException: Cannot call sendRedirect() after the response has been committed
Attachments
Issue Links
- clones
-
HSTTWO-3854 broken sendRedirect
- Closed