Win a copy of Java EE 8 High Performance this week in the Java/Jakarta EE forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to update Session variable with Form Data ?  RSS feed

Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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,
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.
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!