• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem with link label

 
HARSHAD bhawsar
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Frds ,
I have an given link to a string as
<a href=**\myservlet>xyz</a>
after clicking on string 'xyz' a servlet will be called ,I want to pass string 'xyz' to the servlet.
How i should do this?
 
Udayan Naik
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think the following code should work..

Here 'param' can be any name u wish to give.
Then u can retrieve the value of param by

------------------
Udayan Naik
Sun Certified Java 2 Programmer
 
Frank Carver
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A few things about this.
First, you should never use '\' slashes in a URL. Although some browsers (particularly IE) find this acceptable in some situations, it is very non-standard. Please use '/' slashes instead.
Second. You should always put the values of attributes in quotes. This is important for XML and XHTML compatibility, but vital if your parameter values might ever contain spaces or other dangerous characters. Get in the habit of quoting all attribute values now.
So the example give might look more like:
 
HARSHAD bhawsar
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks frds,
It's working.
But what if i want to pass an string like "hello xyz how r u?"
How i can pass it?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic