wood burning stoves 2.0*
The moose likes Servlets and the fly likes best way to collect data and put it in db Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "best way to collect data and put it in db" Watch "best way to collect data and put it in db" New topic
Author

best way to collect data and put it in db

hesham katon
Ranch Hand

Joined: Dec 18, 2002
Posts: 82
Hello everybody,
I am working in a "questionair" which is a many steps wizard
I need to collect all the data
then make a confirmation page
then put them in a mySql db

with my normal way ( getParameter() for each one) it will be difficult .

also which session way i can use

Thanks very much


Hesham Katon<br />SCJP 1.2<br />SCWCD 1.4<br />Better to light a candle than to curse the darkness
hesham katon
Ranch Hand

Joined: Dec 18, 2002
Posts: 82
hello
i think the best way to do this using "Front Controller" design pattern

can any one help me with examples of Front Object Examples using in simple wizard like this

specially jsp front objects

thanks in advance
Al Petersen
Greenhorn

Joined: Nov 27, 2004
Posts: 9
You could use Struts and a session-scoped form bean. As a user goes through the screens, the form bean is filled with data. Then at the end, you pass the data to the business tier for persistence.

- alan
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30116
    
150

Moving to servlets since the question is more about collecting data than putting in database.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60782
    
  65

Adopting Struts just for this one purpose is a bit heavy-handed. It's easy enough to maintain multi-page form data with simple Java classes.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
hesham katon
Ranch Hand

Joined: Dec 18, 2002
Posts: 82
thank you very much

yes Struts will be hard , since i already don't use it , i can't learn it to do this task

Dear Bear,
do you mean normal class , or a JavaBean which store all the fields in it ?

i think it will be good and simple way
what do you think

thank you all
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
you can do it with session.
and about bean that would be just your VO. set the some properties of your bean in first request. then set your bean in session as attribute and then get the bean from session set the remaining properties and so on. on completion just do whatever you want to do with your bean.

you can also go for URL re-writing i think.
 
wood burning stoves
 
subject: best way to collect data and put it in db
 
Similar Threads
c:forEach builds s:selectMany
JSTL SQL TAG
UseBean, scope question.
best way to collect data and put it in db
help me out