Sebastian Ho <[EMAIL PROTECTED]> wrote on 08/19/2004 09:25:38 
PM:

> Thanks Susan.
> 
> Refer to my comments below
> 
> Sebastian Ho
> 
> 
> On Thu, 2004-08-19 at 21:23, Susan Bradeen wrote:
> > Sebastian Ho <[EMAIL PROTECTED]> wrote on 08/19/2004 
05:19:35 
> > AM:
> > 
> > > hi
> > > 
> > > I used the same actionform for a few JSP pages, which I guess is 
good
> > > practice. The problem occurs when I add in validation in my 
ActionForm. 
> > > 
> > > Because in the struts-config, only one <input> is specified for 
every
> > > Action. Therefore, whenever validation fails and struts display the
> > > error messages, struts prints it in the JSP given in <input>.
> > > 
> > > Ideally, struts should forward and prints out the error messages in 
the
> > > JSP that calls the ActionForm.
> > > 
> > > I tried adding in multiple action mapping in my struts-config with
> > > identical settings except <input>, which I hope struts will be smart
> > > enough to decide which mapping to use. Unfortuntely, it doesn't.
> > >
> > 
> > Yes, you can reuse your actionform for multiple action mappings, but 
are 
> > your action mappings really identical except for the input? If I 
> > understand what you are trying to do, it sounds like you should have:
> > 

> > Action1 specifies ActionForm1 and input JSP1 and forwards to JSP1.
> > JSP1 probably then submits to Action2.
> > Action2 specifies ActionForm1 and input JSP2 and forwards to JSP2.
> > JSP2 probably then submits to Action3.
> > Action3 specifies ActionForm1 and input JSP3 and forwards to JSP3.
> > 
> 
> All of them ues the same action Action because I am using
> LookupDispatchAction.
> 
> So the struts-config ideally should be (which doesn't work) :
> Action1 specifies ActionFrom1 and input JSP1.
> Action1 specifies ActionForm1 and input JSP2.
> Action1 specifies ActionForm1 and input JSP3.
> 
> How do I achieve this effect?
> 

<snip/>

Aha, I'm not familiar enough with LookupDispatchAction to offer much help 
off the top of my head. Sorry about that. I don't know if you can call the 
validate() from your LDA methods manually, then if errors come back, 
return a new ActionForward to the proper JSP, depending on what JSP you 
came from (via a hidden field passed in from the JSP?)?

Hopefully someone with more LDA experience will offer more suggestions ...

Susan

_____________________________________________________________________________
Scanned for SoftLanding Systems, Inc. by IBM Email Security Management Services 
powered by MessageLabs. 
_____________________________________________________________________________

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to