You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Olga Agady <oa...@yahoo.com> on 2002/08/11 21:21:28 UTC

Collecting data from several jsp

Hello,

I am using struts in my web application. To register a
customer a need several JSPs with different forms. The
data are not stored in the database until the last
form is filled and "Submit" button is clicked. Could
someone recommed me a good design for collecting data
from several JSPs using struts? Probably this is a
basic question, but I am new in web-application
programming and would appreciate any help.

Regards
Olga

__________________________________________________
Do You Yahoo!?
HotJobs - Search Thousands of New Jobs
http://www.hotjobs.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Collecting data from several jsp

Posted by Olga Agady <oa...@yahoo.com>.
Thanks again, Robert

I believe the approach with the session-timeout is
better than having dozens of hidden fields. Having
information in the bean is easier to debug.

Thanks
Olga


--- Robert Taylor <rt...@mulework.com> wrote:
> You can set the session time out in web.xml for the
> web application.
> 
> <session-config>
>   <session-timeout>30</session-timeout>
> </session-config>
> 
> When the session times out, your bean will gc'd.
> 
> If your bean uses any resources, then you may want
> to wrap it
> in a class that implements
> HttpSessionBindingListener interface.
> 
> From the API:
> HttpSessionBindingListener:
> 
> Causes an object to be notified when it is bound to
> or 
> unbound from a session. The object is notified by an
> 
> HttpSessionBindingEvent object. This may be as a
> result 
> of a servlet programmer explicitly unbinding an
> attribute 
> from a session, due to a session being invalidated,
> or 
> die to a session timing out. 
> 
> Good luck,
> 
> robert
> 
> 
> > -----Original Message-----
> > From: Olga Agady [mailto:oagady@yahoo.com]
> > Sent: Sunday, August 11, 2002 9:32 PM
> > To: Struts Users Mailing List
> > Subject: RE: Collecting data from several jsp 
> > 
> > 
> > Thanks, Robert
> > 
> > I believe the second approach is better for me. I
> have
> > to build the site having in mind that there might
> be a
> > number customers connected to the site at the same
> > time and many of them might start registering and
> > change their mind somewhere in the middle of the
> > process. So, leaving a number of JaveBeans in the
> > session is really risky (unless I can set a
> session
> > time out and remove the abandoned bean when it is
> > timed out).
> > 
> > Thanks again
> > Olga
> > 
> > --- Robert Taylor <rt...@mulework.com> wrote:
> > > One possible solution is to store information
> > > collected from your forms and
> > > store it in a JavaBean in your session. After
> you
> > > persist the information
> > > you could remove the bean from the session.
> > > 
> > > You do run the risk of the user leaving the
> process
> > > and having data hanging
> > > around.
> > > 
> > > Another solution is to "store" the collected
> > > information in hidden form
> > > fields as the user progresses through the
> process.
> > > This way if they leave
> > > the process, no data is left hanging around.
> > > 
> > > This has been discussed before; check the mail
> > > archives at
> > >
> >
>
http://www.mail-archive.com/struts-user%40jakarta.apache.org/
> > > 
> > > HTH,
> > > 
> > > robert
> > > 
> > > > -----Original Message-----
> > > > From: Olga Agady [mailto:oagady@yahoo.com]
> > > > Sent: Sunday, August 11, 2002 3:21 PM
> > > > To: Struts Users Mailing List
> > > > Subject: Collecting data from several jsp
> > > >
> > > >
> > > > Hello,
> > > >
> > > > I am using struts in my web application. To
> > > register a
> > > > customer a need several JSPs with different
> forms.
> > > The
> > > > data are not stored in the database until the
> last
> > > > form is filled and "Submit" button is clicked.
> > > Could
> > > > someone recommed me a good design for
> collecting
> > > data
> > > > from several JSPs using struts? Probably this
> is a
> > > > basic question, but I am new in
> web-application
> > > > programming and would appreciate any help.
> > > >
> > > > Regards
> > > > Olga
> > > >
> > > >
> __________________________________________________
> > > > Do You Yahoo!?
> > > > HotJobs - Search Thousands of New Jobs
> > > > http://www.hotjobs.com
> > > >
> > > > --
> > > > To unsubscribe, e-mail:
> > > >
> > >
> <ma...@jakarta.apache.org>
> > > > For additional commands, e-mail:
> > > > <ma...@jakarta.apache.org>
> > > >
> > > 
> > > 
> > > --
> > > To unsubscribe, e-mail:  
> > >
> <ma...@jakarta.apache.org>
> > > For additional commands, e-mail:
> > > <ma...@jakarta.apache.org>
> > > 
> > 
> > 
> > __________________________________________________
> > Do You Yahoo!?
> > HotJobs - Search Thousands of New Jobs
> > http://www.hotjobs.com
> > 
> > --
> > To unsubscribe, e-mail:   
> >
> <ma...@jakarta.apache.org>
> > For additional commands, e-mail: 
> > <ma...@jakarta.apache.org>
> > 
> 
> --
> To unsubscribe, e-mail:  
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> 


__________________________________________________
Do You Yahoo!?
HotJobs - Search Thousands of New Jobs
http://www.hotjobs.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Collecting data from several jsp

Posted by Robert Taylor <rt...@mulework.com>.
You can set the session time out in web.xml for the web application.

<session-config>
  <session-timeout>30</session-timeout>
</session-config>

When the session times out, your bean will gc'd.

If your bean uses any resources, then you may want to wrap it
in a class that implements HttpSessionBindingListener interface.

>From the API:
HttpSessionBindingListener:

Causes an object to be notified when it is bound to or 
unbound from a session. The object is notified by an 
HttpSessionBindingEvent object. This may be as a result 
of a servlet programmer explicitly unbinding an attribute 
from a session, due to a session being invalidated, or 
die to a session timing out. 

Good luck,

robert


> -----Original Message-----
> From: Olga Agady [mailto:oagady@yahoo.com]
> Sent: Sunday, August 11, 2002 9:32 PM
> To: Struts Users Mailing List
> Subject: RE: Collecting data from several jsp 
> 
> 
> Thanks, Robert
> 
> I believe the second approach is better for me. I have
> to build the site having in mind that there might be a
> number customers connected to the site at the same
> time and many of them might start registering and
> change their mind somewhere in the middle of the
> process. So, leaving a number of JaveBeans in the
> session is really risky (unless I can set a session
> time out and remove the abandoned bean when it is
> timed out).
> 
> Thanks again
> Olga
> 
> --- Robert Taylor <rt...@mulework.com> wrote:
> > One possible solution is to store information
> > collected from your forms and
> > store it in a JavaBean in your session. After you
> > persist the information
> > you could remove the bean from the session.
> > 
> > You do run the risk of the user leaving the process
> > and having data hanging
> > around.
> > 
> > Another solution is to "store" the collected
> > information in hidden form
> > fields as the user progresses through the process.
> > This way if they leave
> > the process, no data is left hanging around.
> > 
> > This has been discussed before; check the mail
> > archives at
> >
> http://www.mail-archive.com/struts-user%40jakarta.apache.org/
> > 
> > HTH,
> > 
> > robert
> > 
> > > -----Original Message-----
> > > From: Olga Agady [mailto:oagady@yahoo.com]
> > > Sent: Sunday, August 11, 2002 3:21 PM
> > > To: Struts Users Mailing List
> > > Subject: Collecting data from several jsp
> > >
> > >
> > > Hello,
> > >
> > > I am using struts in my web application. To
> > register a
> > > customer a need several JSPs with different forms.
> > The
> > > data are not stored in the database until the last
> > > form is filled and "Submit" button is clicked.
> > Could
> > > someone recommed me a good design for collecting
> > data
> > > from several JSPs using struts? Probably this is a
> > > basic question, but I am new in web-application
> > > programming and would appreciate any help.
> > >
> > > Regards
> > > Olga
> > >
> > > __________________________________________________
> > > Do You Yahoo!?
> > > HotJobs - Search Thousands of New Jobs
> > > http://www.hotjobs.com
> > >
> > > --
> > > To unsubscribe, e-mail:
> > >
> > <ma...@jakarta.apache.org>
> > > For additional commands, e-mail:
> > > <ma...@jakarta.apache.org>
> > >
> > 
> > 
> > --
> > To unsubscribe, e-mail:  
> > <ma...@jakarta.apache.org>
> > For additional commands, e-mail:
> > <ma...@jakarta.apache.org>
> > 
> 
> 
> __________________________________________________
> Do You Yahoo!?
> HotJobs - Search Thousands of New Jobs
> http://www.hotjobs.com
> 
> --
> To unsubscribe, e-mail:   
> <ma...@jakarta.apache.org>
> For additional commands, e-mail: 
> <ma...@jakarta.apache.org>
> 

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Collecting data from several jsp

Posted by Olga Agady <oa...@yahoo.com>.
Thanks, Robert

I believe the second approach is better for me. I have
to build the site having in mind that there might be a
number customers connected to the site at the same
time and many of them might start registering and
change their mind somewhere in the middle of the
process. So, leaving a number of JaveBeans in the
session is really risky (unless I can set a session
time out and remove the abandoned bean when it is
timed out).

Thanks again
Olga

--- Robert Taylor <rt...@mulework.com> wrote:
> One possible solution is to store information
> collected from your forms and
> store it in a JavaBean in your session. After you
> persist the information
> you could remove the bean from the session.
> 
> You do run the risk of the user leaving the process
> and having data hanging
> around.
> 
> Another solution is to "store" the collected
> information in hidden form
> fields as the user progresses through the process.
> This way if they leave
> the process, no data is left hanging around.
> 
> This has been discussed before; check the mail
> archives at
>
http://www.mail-archive.com/struts-user%40jakarta.apache.org/
> 
> HTH,
> 
> robert
> 
> > -----Original Message-----
> > From: Olga Agady [mailto:oagady@yahoo.com]
> > Sent: Sunday, August 11, 2002 3:21 PM
> > To: Struts Users Mailing List
> > Subject: Collecting data from several jsp
> >
> >
> > Hello,
> >
> > I am using struts in my web application. To
> register a
> > customer a need several JSPs with different forms.
> The
> > data are not stored in the database until the last
> > form is filled and "Submit" button is clicked.
> Could
> > someone recommed me a good design for collecting
> data
> > from several JSPs using struts? Probably this is a
> > basic question, but I am new in web-application
> > programming and would appreciate any help.
> >
> > Regards
> > Olga
> >
> > __________________________________________________
> > Do You Yahoo!?
> > HotJobs - Search Thousands of New Jobs
> > http://www.hotjobs.com
> >
> > --
> > To unsubscribe, e-mail:
> >
> <ma...@jakarta.apache.org>
> > For additional commands, e-mail:
> > <ma...@jakarta.apache.org>
> >
> 
> 
> --
> To unsubscribe, e-mail:  
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> 


__________________________________________________
Do You Yahoo!?
HotJobs - Search Thousands of New Jobs
http://www.hotjobs.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Collecting data from several jsp

Posted by Robert Taylor <rt...@mulework.com>.
One possible solution is to store information collected from your forms and
store it in a JavaBean in your session. After you persist the information
you could remove the bean from the session.

You do run the risk of the user leaving the process and having data hanging
around.

Another solution is to "store" the collected information in hidden form
fields as the user progresses through the process. This way if they leave
the process, no data is left hanging around.

This has been discussed before; check the mail archives at
http://www.mail-archive.com/struts-user%40jakarta.apache.org/

HTH,

robert

> -----Original Message-----
> From: Olga Agady [mailto:oagady@yahoo.com]
> Sent: Sunday, August 11, 2002 3:21 PM
> To: Struts Users Mailing List
> Subject: Collecting data from several jsp
>
>
> Hello,
>
> I am using struts in my web application. To register a
> customer a need several JSPs with different forms. The
> data are not stored in the database until the last
> form is filled and "Submit" button is clicked. Could
> someone recommed me a good design for collecting data
> from several JSPs using struts? Probably this is a
> basic question, but I am new in web-application
> programming and would appreciate any help.
>
> Regards
> Olga
>
> __________________________________________________
> Do You Yahoo!?
> HotJobs - Search Thousands of New Jobs
> http://www.hotjobs.com
>
> --
> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>