Uploaded image for project: '[Read Only] - Hippo Site Toolkit 2'
  1. [Read Only] - Hippo Site Toolkit 2
  2. HSTTWO-3856

[Backport 4.0] broken sendRedirect

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Fixed
    • 4.0.3, 4.1.0
    • 4.0.4
    • None
    • None
    • 0
    • Platform Sprint 142, Platform Sprint 143

    Description

      Reproduction path:

      1. create an archetype project
      2. 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);
            }
        }
        
      3. configure the component class on some page and link a sitemap called redirect on it
      4. 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

          Activity

            People

              Unassigned Unassigned
              aschrijvers Ard Schrijvers
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: