I then call another JSP where I display the data entered to confirm if user wants to insert into the dbase, from there I call another JSP where I try to insert it into a Dbase using JSTL tags but I cant access the values in this JSP as it seems that the bean gets reset or something. I am using request scope in all 3 JSPs when i specify the bean. But it seems I can only get the bean's values to be available in the next immediate JSP called to show the user what he entered but not the third JSP where i actually try to insert the data into the DBase. If I use session scope I end up with the same data in the database each time I insert. What do I do??
Originally posted by Arvind Birla: I have a form where I accept the values and call another JSP which populates the bean with the data
That is a very outdated and frowned upon practice. Modern standards dictate that you should be submitting data to a servlet for processing. JSPs should only be used to construct views.
I then call another JSP
JSPs are not methods that you "call" so the term is not meaningful. How are you transferring to the second JSP? Redirect? Forward? Same with the 3rd JSP. (3rd, JSP?! This is a bit of a mess, isn't it?)
The ideal solution is to refactor the processing to servlets and avoid all this JSP trickery. Failing that, we need to know the details of the resource transitions to determine where the scoped variable is being dropped. A request-scoped variable will be lost whenever a new request is created as a result of a redirect.