jQuery in Action, 3rd edition
The moose likes JSP and the fly likes passing variables to jsps Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "passing variables to jsps" Watch "passing variables to jsps" New topic

passing variables to jsps

shruti patel
Ranch Hand

Joined: Mar 10, 2008
Posts: 52
how can we pass a variable declared in one JSP to another JSP?

[edited subject to use a meaningful subject - was "interview question"]
[ May 18, 2008: Message edited by: Jeanne Boyarsky ]
kappiil patel

Joined: Aug 06, 2006
Posts: 14
By putting that variale in session if you are maintianing it.
Second is that, you can pass variable as parameter after URL string and pass it to JSP
Ben Souther

Joined: Dec 11, 2004
Posts: 13410

How you did you answer this question in your interview?

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Sidharth Pallai
Ranch Hand

Joined: Apr 21, 2008
Posts: 134

If you need to pass a value while a invoking a JSP, you can better use <jsp:param name="abc" value="xyz"/> embedded inside <jsp:include>.Or'else you can use a session to bind values.

Thanks & Regards
Sidharth Pallai
I agree. Here's the link: http://aspose.com/file-tools
subject: passing variables to jsps
jQuery in Action, 3rd edition