RE: Design Question - Need to put assertions in Actions?

2003-09-05 Thread Marco Tedone
Message-ID:
<[EMAIL PROTECTED]>
From: "White, Joshua A (HTSC, CASD)" <[EMAIL PROTECTED]>
To: Struts Users Mailing List <[EMAIL PROTECTED]>
Subject: Design Question - Need to put assertions in Actions?
Date: Fri, 5 Sep 2003 08:53:49 -0400
MIME-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"

 Say I have a form "formFoo" which manages some noun "Foo".  It has
two different actions, "newFoo" and "editFoo".  Each has specific logic
depending on whether or not Foo exists.  I am experiencing a problem where
users create Foo, but then (either by bookmark or the back button) users are
returning to the "newFoo" action and edit Foo using the "new" action instead
of the "edit" action.

What about to create a custom tag which, if the newfoo already exists,
simply redirect the user to the editfoo form? In any case, take in account
that the 'Back' button issue is a known problem among web applications, and
that users should be aware of it.

My 2 cents,

Marco


I have looked into the transaction token to eliminate the double submit
problem, but I have not found a solution to this problem.  So far, I have
placed some assertions in the "newFoo" action which validates that foo does
not already exist.  If it does exist, it forwards control to "editFoo".

This brings about the design question.  Putting this kind of
assertion/redirection logic in each action class gets messy fast and makes
each action class more of a controller than an action class.  (Which is not
where I want to go)

Any suggestions on how to handle this type of problem?

Regards,

Joshua




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



Design Question - Need to put assertions in Actions?

2003-09-05 Thread White, Joshua A (HTSC, CASD)
Say I have a form "formFoo" which manages some noun "Foo".  It has
two different actions, "newFoo" and "editFoo".  Each has specific logic
depending on whether or not Foo exists.  I am experiencing a problem where
users create Foo, but then (either by bookmark or the back button) users are
returning to the "newFoo" action and edit Foo using the "new" action instead
of the "edit" action.  

I have looked into the transaction token to eliminate the double submit
problem, but I have not found a solution to this problem.  So far, I have
placed some assertions in the "newFoo" action which validates that foo does
not already exist.  If it does exist, it forwards control to "editFoo".

This brings about the design question.  Putting this kind of
assertion/redirection logic in each action class gets messy fast and makes
each action class more of a controller than an action class.  (Which is not
where I want to go)

Any suggestions on how to handle this type of problem? 

Regards,

Joshua



This communication, including attachments, is for the exclusive use of 
addressee and may contain proprietary, confidential or privileged 
information. If you are not the intended recipient, any use, copying, 
disclosure, dissemination or distribution is strictly prohibited. If 
you are not the intended recipient, please notify the sender 
immediately by return email and delete this communication and destroy all copies.


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