Hi,
    You are almost close. the only problem with this model is
that I am very closely coupling it in the code. So 
according to this design LoginAction will every time follow
GetAccount Action.which I donot think is the desired functionality.
rather It should Ideally go in the descriptor and descriptor should look some thing 
like 
this.
      Now assume that I am using LoginAction in my two products say in my lead manager
and other one in Inventory manager module
So Ideally the descriptor should look like this
        For login in lead manager:
<action name="loginLeadManager" success="accountPage.jsp" failure="login.jsp">
    <action classname="com.tavat.loginAction" />
    <action className="com.tavant.getAccountsAction" />
</action >
        For login in Inventory module:
<action name="loginInventoryManager" success="myInventoryPage.jsp" failure="login.jsp">
    <action classname="com.tavat.loginAction" />
    <action className="com.tavant.getInventoryAction" />
</action >

So this is how I think I can have a perfect decoupled code.
I donot think Struts give this great support.

Please note the tags I am using are just dummy ones  and are used to explain the whole 
stuff.
Thanks,
Sourav Das

----- Original Message ----- 
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, January 27, 2003 6:12 PM
Subject: RE: how to call more than one Struts Action for a given HTTP request


> Hi,
> If i understand u right u are saying that same request will be handled by more 
> than one action..
> e.g. Some thing like if user logs in, check his login credentials and then give 
> him the list of his accounts in a banjking app.So u wil like to have a 
> LoginAction(which just checks login) and a getAccountsAction(which just fetches 
> accounts for a given user..)So that they can be reused in other context...
> I think this is how u will design a struts application..And u just need to do 
> the following..
> 
> From the jsp, call the first action(LofinAction.do in our case),In the first 
> action ,do the work(check login in our case)and do the necessary forward(in our 
> case maping.findFroward("success") or  maping.findFroward("failure")) at the 
> end.And when defining the Actons mapping for LoginAction, define the 2 forwards 
> success and failure.The success will point to the mappinfg for the next action 
> which is getAccountsAction in our case..
> 
> Hope this helps,
> regards,
> Shirish
> 
> -----Original Message-----
> From: Souravmay.Das [mailto:[EMAIL PROTECTED]]
> Sent: Monday, January 27, 2003 1:14 PM
> To: struts-user
> Subject: how to call more than one Struts Action for a given HTTP
> request
> 
> 
> Hi All,
>             I have a question can we call more than one Struts action for a
> HTTP Request. Do you have any idea how to do it. The basic idea of having
> more than one Struts actions, is for getting more fine grained reusable
> component.
>  
> With regards,
> Sourav Das
>  
> 
> 
> --
> To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
> 

Reply via email to