Enter your email address:

Delivered by FeedBurner


Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to pass and get values in href as parameters in Jsp
12-13-2011, 12:04 AM (This post was last modified: 12-13-2011 12:06 AM by rajasri.)
Post: #1
Its My Birthday! How to pass and get values in href as parameters in Jsp
Today we are going to learn an important thing which looks simple but has major advantages.
To pass the parameter in jsp first assign the value you want to pass to a variable
ex:
For passing session variable use
String name=(String)session.getAttribute("name");This session variable is already set before itself.Otherwise you want simply pass one value then assign String name="s2sgateway";Then pass value as below

<%out.println("<a href=\"newpage.jsp?ex="+name+"\">Click to Pass</a>");%>

Now you can get the value ex in newpage.jsp as
String a=request.getParameter("ex");
So you can pass as many values as you want any doubt ask us.

Happy Coding
Find all posts by this user
Add Thank You Quote this message in a reply
Advertise here or at any positions around our site send a mail to info@walkinsforum.com
Post Reply 


[-]
Share/Bookmark (Show All)
Facebook Linkedin Technorati Twitter Digg MySpace Delicious

Possibly Related Threads...
Thread: Author Replies Views: Last Post
Sad how to import a csv file values in to database using jsp rajasri 2 1,212 02-20-2012 12:17 PM
Last Post: rajesh2407
Shocked update using parameters in jsp page rajasri 0 434 12-14-2011 11:34 AM
Last Post: rajasri
Big Grin Retrieve database table values in loop using jsp rajasri 0 694 12-12-2011 11:24 PM
Last Post: rajasri
Tongue Servlet example for printing random values rajasri 0 224 12-12-2011 06:48 PM
Last Post: rajasri
  Servlet example for printing random values admin 0 517 11-28-2011 06:30 PM
Last Post: admin

Forum Jump:


User(s) browsing this thread: 1 Guest(s)