• Post Reply Bookmark Topic Watch Topic
  • New Topic

retrieving value from a jsp file  RSS feed

 
j u ray
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello everybody,
i need 1 help. i am having 3 ".jsp" files : x1.jsp,x2.jsp and x3.jsp. in x1.jjsp i am having a combo box, from the combo box i am selecting 1 value. there is a submit button below it. i am using "form method = post action=x2.jsp". the value which i am selecting from combo(of x1.jsp), i am retrieving the value in x2.jsp by "request.getParameter("variable_name");"

but how to retrieve that value which i am selecting from combo(of x1.jsp) in x3.jsp as i need to run a query using that value.

please send me the code for this.

thanks in advance.
 
Lorand Komaromi
Ranch Hand
Posts: 276
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
j u ray wrote:
but how to retrieve that value which i am selecting from combo(of x1.jsp) in x3.jsp as i need to run a query using that value.


In x2.jsp you could put it into the session. jsp+session
 
Albareto McKenzie
Ranch Hand
Posts: 304
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the workflow? x1 -> x2 -> x3? Who calls x3?

if x2 calls x3 just pass it as a param, as you do from x1 to x2
 
Vijitha Kumara
Bartender
Posts: 3973
24
Chrome Fedora Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Lorand Komaromi wrote:
j u ray wrote:
but how to retrieve that value which i am selecting from combo(of x1.jsp) in x3.jsp as i need to run a query using that value.

In x2.jsp you could put it into the session. jsp+session

Or if that is only intended to the next JSP (x3.jsp) append those as request params to the request URL.
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hmm you can use request scope also if you are forwarding to x3.jsp.well So, you are using x2.jsp as a controller? which is poor practice. are you working in a maintanace project,which is developed in 2002?[please google for"servlet"]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!