> From: "Nicholas L Mohler"
> <[EMAIL PROTECTED]>
> Date: Mon, 17 May 2004 09:27:11 -0400
> 
> Hi Jacob,
> 
> I asked almost the same question when we were
> implementing validation.  We
> had the same issue with preparing things before
> creating the user page.  We
> ended up creating an input that forwarded to a
> mapping that was basically a
> duplicate of the one with the validation failure. 
> The only differences
> were (1) There was no validation in the second
> mapping and (2) the second
> mapping used a different parameter so that we could
> return to the exact
> page (edit/create) that created the validation
> failure.
> 
> You are on the same path that we used.  It isn't as
> elegant as it could be,
> but it is less code than if we did it all "by hand".
> 
> I don't know if I have the right class name, but I
> would think that you
> could extend the RequestProcessor and have it behave
> a little differently
> when the validation fails...
> Nick

Are you duplicating pages and/or entries in the
structs-config.xml?

I implemented this for my project:

 http://tinyurl.com/33cbw

Example:

<action
path="/FooCRUDOperation"
type="com.myco.editors.FooAction"
name="FooForm"
scope="request"
input="/FooCRUDInput.do"
parameter="dispatchAction">
<forward name="edit" path=".editor.foo.Update"/>
<forward name="edit"   path=".editor.fooCreate"/>
<forward name="view"   path=".editor.fooView"/>
<forward name="top"   path=".editor.fooTop"/>
</action>

The pages are pre-populated correctly and errors are
shown on the appropriate page (i.e. when you're on the
Edit page and an error occurs, the user is taken back
to the Edit page with their previously entered data
along with the error messages on top).

I extended LookUpDispatchAction to DoTheRightThing
when "dispatchAction" was missing from the request:

LIST MODE: /FooCRUDOperation
EDIT MODE: /FooCRUDOperation?id=4

Is there a better way to do things?

- Ron


        
                
__________________________________
Do you Yahoo!?
SBC Yahoo! - Internet access at a great low price.
http://promo.yahoo.com/sbc/

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

Reply via email to