Session scoped forms are one of my favorite things about Struts. Seems like you have a situation for them.

Make sure you keep all session-scoped form fields Serializable or mark them as transient if they are not.

Clever implementations of ActionForm.reset can make memory management easier. The "complication" is simply that you might hold on to references to objects that should have been garbage once processing is complete.

If you don't use session scoped forms, you will probably have to manage objects using session scope one way or another, unless you somehow use hidden variables to specify "running" objects that get recreated for each request.

Erik

lixin chu wrote:

solution 1. persisting data may cause some problems,
for example performance, as users may need to create a
few detail objects. I prefer to keep these objects in
View and provide a 'Done' button, which will then let
Action to do the persistence.

Another problem is that in my Use Case, the detail
objects are associated to the parent object, which
might not be persisted at this moment (because we go
to B.JSP before saving data in A.JSP). So i can not
persist detail object first.

some work needed to solve these.

solution 2. I am not sure if Struts Workflow extension
is a good choice. It seems that it uses Session scope
for sharing data among a few JSP pages.
What complication will it have ?

thanks !



--- "Kataria, Satish" <[EMAIL PROTECTED]> wrote:



It depends upon the architecture you want to follow.
There are multiple
ways this can be done

1. Create the 2 jsp as independent jsp. Thus the
list jsp jsp always
fetches from DB when we bring control to that.
  Clicking add on the list jsp leads to the
adddetails jsp which submit
data to DB.
  This is the most commonly used and I have seen
this being used
successfully in multiple applications
2. Create the 2 jsp as a wizard using struts session
scope strategy.
  This strategy has certain complications and is
generally
disadvantageous.

Thanks,
Satish Kataria



-----Original Message-----
From: lixin chu [mailto:[EMAIL PROTECTED] Sent: Monday, August 16, 2004 4:59 AM
To: [EMAIL PROTECTED]
Subject: best practice: how to handle two related
jsp pages, with one
having an ArrayList, the other input details



Hi, How should I handle this:

I have 2 jsp, in a.JSP, I need to display an
ArrayList. When users click 'Add', B.JSP is
displayed
which allows users to fill in the details of a new
object. When users click 'Done', I need to return
back
to A.JSP, display the newly added object, and
ArrayList should be updated as well.

What do I need to do to support this ?

thank you very much
li xin



__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - Send 10MB messages!
http://promotions.yahoo.com/new_mail





---------------------------------------------------------------------


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




---------------------------------------------------------------------


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








__________________________________
Do you Yahoo!?
Take Yahoo! Mail with you! Get it on your mobile phone.
http://mobile.yahoo.com/maildemo


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





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



Reply via email to