i have developed jsp where i have text fields and combo box
once i select the region in the combo box it will call a action class where it get the values based on selected region in combo box
using a javascripot and return back to the same screen
and the results are displayed in the same screenn in the location combo box
it works 5n but when the screen is refreshed again what ever the values that iam entering in the text box and other field get disappeared
what should i do in this case
Joined: May 14, 2004
Hi, You need to read and store the request parameters in the request attributes when control comes to your action class for fetching data. While rendering the JSP you need to check for values in request attributes and populate them. If there are no values then it will be empty(which is the case when you visit the page first time.) Thanks, amit
Joined: Feb 08, 2006
This simple case is one where an Ajax solution works very well. Since you would only be refreshing the one list on the page you would not have to worry about the other fields because they would not change.
With a non-Ajax solution you need to submit the page. In your action you need to detect that the page was submitted because a list needed to be populated (and not because the user wanted to save the data). On my project there is some common code to handle this that then forwards to the action specified in the input attribute of the mapping..