• Post Reply Bookmark Topic Watch Topic
  • New Topic

Persistence with links?

 
Howard Ralston
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Howdy folks,
What I'm trying to figure out is this: If I click on a link, I want to assign a value to a session variable so I can use that information on the next JSP.
For example, if I click on a link (Atlanta), which takes me to the JSP page "cities.jsp", I want to be able to access a variable with the value "Atlanta" in order to pull the Atlanta information from my database. If I had clicked on the (Chicago) link, I would have had "Chicago" in the variable when I went to "cities.jsp".
Any advice would be most welcome.
Thanks,
Howard
 
Brian Glodde
Ranch Hand
Posts: 171
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are a few different ways to do that, here's one:

Then you can retrieve the value on the following jsp:

It would probably be better if you used the row id of the city rather than the name. You won't need to use any session variables...
The JSP/Servlet JavaDocs should also help get you started.
[ May 01, 2002: Message edited by: Brian Glodde ]
 
Howard Ralston
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Brian! I will try it out right now.
Howard
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!