Set request attributes when a Form is POSTed
- by ssahmed555
Is there any way to set request attributes (not parameters) when a form is posted?
The problem I am trying to solve is: I have a JSP page displaying some data in a couple of dropdown lists. When the form is posted, my Controller servlet processes this request (based on the parameters set/specified in the form) and redirects to the same JSP page that is supposed to display addition details. I now want to display the same/earlier data in the dropdown lists without having to recompute or recalculate to get that same data.
And in the said JSP page, the dropdown lists in the form are populated by data that is specified through request attributes. Right now, after the Form is POSTed and I am redirected to the same JSP page the dropdown lists are empty because the necessary request attributes are not present.
I am quite the n00b when it comes to web apps, so an obvious & easy solution to this problem escapes me at the moment!
I am open to suggestions on how to restructure the control flow in the Servlet.
Some details about this app: standard Servlet + JSP, JSTL, running in Apache Tomcat 6.0.
Thanks.