aspose file tools*
The moose likes Servlets and the fly likes design advice required Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "design advice required" Watch "design advice required" New topic
Author

design advice required

madhav lakkhani
Greenhorn

Joined: Jun 04, 2002
Posts: 12
Hi ,
Iam having Forms in which I have to take some data that is numeriacal data
and submit it in to my Database there r near about 10 forms that
r linked one to other and last one check the totals for all...
basic thing is this all forms r having near about 100 fields
condition is this if all conditions satisfy of totals in form 10th
than insert all values to database means data of all forms 1 to 10.
.more clear is one user willl have this all forms in one session
Iam using JSP and javabeans. .javascript
Is there any sugesstion in design frame work which make it easy and accurate....
regds
L Goundalkar
Ranch Hand

Joined: Jul 05, 2001
Posts: 395
Hi,
You can keep the form values in session variables until you reach the last form. Then once the condition satisfies, you can call the bean method which has SQL query to update the database.
You can have Info class which will hold the form field values and instatiate the same and put it in the session.
When you reach the last form or page send this info bean to the method which updates the database. In the bean method, extract the values from the info bean and use it in the SQL query.
Cheers.


SCJP, SCWCD
madhav lakkhani
Greenhorn

Joined: Jun 04, 2002
Posts: 12
Thx for answer
C i think that if i will put 100 multiply 10 that is 1000 values in session b4 submiting to database it will take too much of client memory as well as lot os server network traffic for every request ..
pls suggest much more
regds
L Goundalkar
Ranch Hand

Joined: Jul 05, 2001
Posts: 395
Hi,
Since you have too bulky data, you can have two approaches.
1. Try to save the data on the client side, i.e. either using cookie or using an XML file. But This may fail if user disables cookies.
2. Since you have session id of the user, you can store the data in a temporary xml or text file ( convinient to you..) on the server for every submit in the page. So my temporary file will be named using the session id and will be appened for every page submit with the page field values.
Once the user submits on the last page then you can send the file from client i.e. read the cookie value or fetch the file on the server itself depending on the above two scenarios and update the database.
Hope this helps.
Cheers.
madhav lakkhani
Greenhorn

Joined: Jun 04, 2002
Posts: 12
Thx for u r answer ..
iam going to try this approach but not much positive abt
regds
L Goundalkar
Ranch Hand

Joined: Jul 05, 2001
Posts: 395
Hi, I am not sure about sending the XML or formatter text file from server to client. Try out the Session one. Its easy to implement.
Write a bean which appends the data to a file or xml and for every submit on the page pass the values to the bean from your server side scriplet.
Then for the last one invoke the bean method which reads the file from your server and updates the database.
I think its easy to implement.
Cheers.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: design advice required