aspose file tools
The moose likes JSP and the fly likes JSP - Selfsubmiting help Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » JSP
Reply Bookmark "JSP - Selfsubmiting help" Watch "JSP - Selfsubmiting help" New topic
Author

JSP - Selfsubmiting help

Mike Vat
Greenhorn

Joined: Sep 09, 2008
Posts: 10
I am having a basic question, but not able to figure it out how. Appreciate your help greatly.

I ahev a JSP page with several bunch of fields and I also have a dropdown box and let call this as "Codes". When this jsp page first oaded user will enter few firlds. Based on that data I need to get the "Codes" dropdown box data from the server by submitingthe page. My questions is, When Submit the page how do I keep the data in the controls with out loosing the data when it reloads the JSP Page ? Is there any specific thing I need to do ? Also When the pAge first Loads I need to execute some branch of server side code and When it reloads (When the User clicks "ErrorCode" dropdown) then it should execute different set of servser side code ? How Can I do this ?

I geatly appreciate your help.

Thanks
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56200
    
  13

You can use the value attributes of the elements to set their initial values to whatever they were when the page was submitted.

Or, you can avoid the whole problem by employing Ajax to do the submission behind the scenes.


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
Mike Vat
Greenhorn

Joined: Sep 09, 2008
Posts: 10
Thanks for the reply. Can you please help me little more about it on how I should use VALUE attributes ?

Do you mean

<input type="text" value = ??? -> This attribute you are talking about ?

thanks very much for your reply.

thanks
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56200
    
  13

Yes. You have the data that was submitted, so it's just a matter of putting it back into the value attributes.

For example:
Mike Vat
Greenhorn

Joined: Sep 09, 2008
Posts: 10
Thanks very much it is working.
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: JSP - Selfsubmiting help
 
Similar Threads
Dependent dropdowns and Multiple select swap
Dropdown values for JSP
JSP and Dropdown Box
Color Rows of a Table
Jsp Frameset Help