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

Backport [3.0.1]Redirects from non root HstComponents are broken

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Fixed
    • 3.0.0
    • 3.0.1
    • None

    Description

      Reproduction:

      In archetype created project, create an HstComponent

      package org.onehippo.cms7.hst.beans;

      import java.io.IOException;

      import org.hippoecm.hst.component.support.bean.BaseHstComponent;
      import org.hippoecm.hst.core.component.HstComponentException;
      import org.hippoecm.hst.core.component.HstRequest;
      import org.hippoecm.hst.core.component.HstResponse;

      public class RedirectComponent extends BaseHstComponent {

      @Override
      public void doBeforeRender(final HstRequest request, final HstResponse response) throws HstComponentException {
      try

      { response.sendRedirect("/foo"); }

      catch (IOException e)

      { e.printStackTrace(); }

      return;
      }
      }

      then, on a child component, say http://localhost:8080/cms/console/?1&path=/hst:hst/hst:configurations/gettingstarted/hst:pages/homepage/main

      set

      hst:componentclassname = org.onehippo.cms7.hst.beans.RedirectComponent
      

      Result is :

      [INFO] [talledLocalContainer] 23.09.2015 17:15:20 WARN http-nio-8080-exec-1 [AggregationValve.invoke:225] 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:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: