struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Adam Fisk" <af...@speedymail.org>
Subject getting redirect to work -- easy one?
Date Wed, 17 Sep 2003 04:02:04 GMT
Hopefully this is an easy one for someone to answer. I'm simply trying to
set up an action-mapping that performs a redirect instead of a forward.
If I use the following xml in struts-config.xml (I'm using
**struts-faces**), then everything "works":

<action
  path="/search"
  type="com.wheels.struts.SearchAction"
  name="searchForm"
  scope="request"
  input="search">
  <forward
    name="results"
    path="faces/results.jsp"
  />
</action>

I get an error if I change the forward to be a redirect, however, as in:


<action
  path="/search"
  type="com.wheels.struts.SearchAction"
  name="searchForm"
  scope="request"
  input="search">
  <forward
    name="results"
    path="faces/results.jsp"
    redirect="true"
  />
</action>

The error I get is:

java.lang.IllegalStateException: Cannot forward after response has been
committed

Any thoughts on this one? Is there something I need to change in my
Action class to properly redirect instead of forward? Something in
struts-config.xml??  I read earlier posts about creating an
ActionRedirect subclass of ActionForward, but it seems like this should
not be necessary.  Keep in mind I'm using struts-faces -- not sure if
that makes a difference.

Thanks very much.

-Adam
-- 
  Adam Fisk
  afisk@speedymail.org

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Mime
View raw message