File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes Display same Data in JSP after reloading it Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Display same Data in JSP after reloading it" Watch "Display same Data in JSP after reloading it" New topic

Display same Data in JSP after reloading it

Dipti Lokhande

Joined: May 05, 2007
Posts: 9
JSP is as follows :

Marks Details

Student Type : cboStudentType (combo box)
Student Name : cboStudentName (combo box)
Marks 1 : txtMar1 (text field)
Marks 2 : txtMar2 (text field)
Marks 3 : txtMar3 (text field)
Total : txtTotal(text field)

In above form , depending on selected student type, stident names will be fetched from the data table. After entering marks1, marks2 and marks3, Total should be calculated. Whenever total will be displayed, selected student type, student name and all marks should be restored back in the page.
Please do tell me how to achieve this?
viju vi

Joined: Nov 15, 2007
Posts: 7
hi you can try doing this, this is one option give a onchange event to your combobox so that when a studenttype is selected trigger a javascript which send a request back to same page send the studenttype and while loading the page fetch the studenttype and send a database call to get the list of students data. and once this is done load the student names to the studentname combobox. similarly on selection of a particular student name send request to the same page by forwarding the type and name with it. and make a cal to fetch the marks, if no entry found load the input filed to enter and submit or else display the entered fields

your jsp will have following

thats all
[ December 06, 2007: Message edited by: Ben Souther ]

"No problem can be solved from the same level of consciousness that created it." Albert Einstein
I agree. Here's the link:
subject: Display same Data in JSP after reloading it
It's not a secret anymore!