Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

carrying values through querystring  RSS feed

 
karthik mahalingam
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all
i want a clarification regarding HTML and JSP
Im sending a value in the query string of the <A href...>tag...and i want to acccess the same in a JSP....

normally i could access the value passed with the help of request.getParameter() method...this is applicable when my <a href ...is part of a form.

In situations where my <a href...>tag is not a part of a form i couldnt use the value passed thru request.getParameter statement...

also i dont want to make use of sessions here.

please provide me with a solution..
 
Jason Milliron
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think I understand your problem. You want to access variables from and html page using a href link on the second page. If this is your problem, here is the solution:

1st page: one.html

<html>
<body>

<a href="two.jsp?fname=Jason&lname=Milliron">Goto Next Page!</a>

</body>

</html>

2nd page: two.jsp

<html>
<body>
My first name is <%= request.getParameter("fname") %>
<p>
My last name is <%= request.getParameter("lname") %>
</body>
</html>

Let me know if this helps. It doesn't use a form to pass the info.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!