aspose file tools*
The moose likes Servlets and the fly likes How to update Session variable with Form Data ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "How to update Session variable with Form Data ?" Watch "How to update Session variable with Form Data ?" New topic
Author

How to update Session variable with Form Data ?

Seema Hanji
Ranch Hand

Joined: Jan 29, 2001
Posts: 37
Hi All ,
I have a JSP page that gets data from database and displays.
One of the Form fields(It is a Drop down box.) on this page has a 'Edit' button . This field is populated with data from a bean which has session scope(jsp:useBean id="..." class="java.util.Vector" scope="session").
When this 'Edit' is pressed , it brings up a popup JSP page (using Javascript window.popup), which has a Table of INPUT fields filled with values from drop down box, and hence allowing user to modify them .
This JSP also has bean with same id as 1st page , hence has access to values of this bean . This Page has a submit button to submit data after modification.
So , on submit ,
1> I need to update the session bean,
How do I do it in JSP ??? . I can only access form field values through Javascript right ??
Right now , I am sending request to a servlet , which is copying form field values to session variable, and then sending request to first JSP page.
2> close the popup window.
I am trying to close widow in Javascript after submit,
form.submit();
window.close();
It doesn't work.

3> and refresh first window with updated bean contents.

Please help me in this , Any suggession is welcome.
Thanks in advance.
 
 
subject: How to update Session variable with Form Data ?