This is not a bug in Struts, neither in Components / Extended Template.
  You can't do a sendRedirect() once you have start to write the response.

  What you are trying to do is to build a page, and when you encounter a special 
condition, you want
to build another page, dropping the previous one.
  When I am facing such problem, I put the condition test in an action, before 
building any page.
Then, the action use the forward mechanism to forward to appropriate page.

    Cedric

 Rajasekhar Bodduluri wrote:

> Hi all,
>
> My definition:
>  <definition name="forward.login" path="/layout/classicLayout.jsp">
>    <put name="title"  value="ICC(CSGnet)" />
>    <put name="header" value="/common/header.jsp" />
>    <put name="footer" value="/common/footer.jsp" />
>      <put name="menu"   value="menu.main" />
>    <put name="body"   value="login.jsp" />
>   </definition>
>
> in header.jsp i like to call response.sendRedirect("test.jsp") for one
> logic, but i got exception
> "Response has already been committed' java.lang.IllegalStateException:
> Response has already been committed at
> 
>org.apache.tomcat.facade.HttpServletResponseFacade.sendError(HttpServletResponseFacade.java:210)"
>
> if i call directly to  www.test.com/header.jsp it works fine.
>
> is it bug in struts?
>
> please let me know if any body knows.
>
> thanks & regards
> raj

Reply via email to