I have used HTML in my Java class and in one case I have used <a href="...">username</a>
. Username is a variable that gets values dynamically. In one case its value is 'rg@bg' but here instead of the name I'm getting the URL to which it is directed in my jsp. How do I ensure that the value of username comes on the display page as it is.
I have tried "@"+username. Didn't work
views:
43answers:
2
A:
I'm not sure I understand your problem, but here is a guess.
I suspect you do the actual print wrong. If the variable is called username
and "username" is printed instead of the content of username
it seems you need to do something like
print("<a href=\"...\">" + username + "</a>");
instead of
print("<a href=\"...\">username</a>");
In jsp you could also simply write
<a href="..."><%= username %></a>
If the problem concerns treatment of html-entities you may find the following interesting:
aioobe
2010-05-04 09:09:24
no i am not getting it as username. i m getting d url it has to be directed to. it works fine for all other names
swati
2010-05-04 10:15:31
+1
A:
You don't have greasemonkey installed which automatically converts email patterns into links?
Daniel
2010-05-04 18:10:17