You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Pedro Salgado <sa...@04web.com> on 2003/12/16 13:06:00 UTC

mapping.getForwardForward()?

Hello to everyone, 
   
  I have read Chuck Cavaness's book explanation but still I still don't
understand. If I extend an Action class then I can use the forward, include
and type attributes in any way I like, right? (the book says something about
being mutually exclusive)

        <action path="/Action"
            type="pkg.pkg1.classA"
            input=".tile.before"
            forward=".tiel.after"
            name="form"
            validate="true"
        />

  Why I am making this question: many of my actions only use a forward
("success") and use the input attribute to go back, in case of an error.
  Since I usually have 1 input and 1 forward, instead of defining the same
forward "success" in every action, I was hoping that I could use the forward
attribute (or any other) to send the request to a Tiles definition or JSP
resource, when everything goes "well"... something like:

      execute() {
  
      return (new ActionForward(mapping.getForward()));
      (I still couldn't make it work properly... And I don't know if there
is any way I can do this... If it stills works with modules).
      
      }

  On those cases that I have 1 input page and more than one action that will
end up to the same input page (also very common), I solved with a
DispatchAction and use the mapping.getInputForward() to solve the problem,
but on the previous case, I think there is something very simple missing to
make it all work.

      Just one more question... What is the difference of extending
org.apache.struts.action.Action or org.apache.struts.actions.ForwardAction?
I have looked at the source code and, if I override the execute() method
then it will be pretty much the same... right?


Thank you,

Pedro Salgado


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