Details
-
Bug
-
Status: Closed
-
Blocker
-
Resolution: Fixed
-
4.1.0
-
None
-
None
-
1
-
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
- is cloned by
-
HSTTWO-3856 [Backport 4.0] broken sendRedirect
- Closed
- relates to
-
HSTTWO-3675 HstComponents that do not write content to the response body do not get their cookies flushed to the parent response
- Closed
-
HSTTWO-1038 Allow sendRedirect() in doBeforeRender() under non-portal environment.
- Closed