GeeCON Prague 2014*
The moose likes Struts and the fly likes How to use <a href= in resource bundle file" title="" /> Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Frameworks » Struts
Bookmark "How to use <a href=""> in resource bundle file" Watch "How to use <a href=""> in resource bundle file" New topic
Author

How to use <a href=""> in resource bundle file

swapnil dangore
Ranch Hand

Joined: Jun 05, 2006
Posts: 46
Hi Ranchers,
On my jsp I am displaying a message from resource bundle. Some part of this message contains a hyperlink. Please, tell me how can use for the value in properties file.
Here is a dummy example

Message Resource:

mykey=This is swapnil guys.Want your help.Want to visit
 Javaranch.How to do?.

Jsp File:

<bean:message key="mykey"/>

Here it is getting displayed as it is, "This is swapnil guys.Want your help.Want to visit  Javaranch.How to do?."
Wherein I want a link on "Javaranch".

Help me out...


Cheers<br />-------------<br />Swapnil<br /> <br />SCJP5-81%<br /> <br />"Dictionary is the only place where Success come before Work"
swapnil dangore
Ranch Hand

Joined: Jun 05, 2006
Posts: 46
Guys,
The anchor tag I used in value attribute(a href="some link".) for Javaranch, got converted to a link.
But,on my Jsp, its not rendering a link. Its simple a plain text that we use for link a href="some link".
Ryan Silva
Greenhorn

Joined: Nov 04, 2009
Posts: 7
I'm having a hard time understanding what you're saying. But it sounds like your HTML is getting escaped. I'm not familiar with the bean:message tag, but maybe if you did some googling for not escaping HTML. Or maybe if you didn't store the HTML in the string but used parameters to insert the HTML later. Normally when you store strings you're not intending to store HTML but the actual words that might need translating.
 
 
subject: How to use <a href=""> in resource bundle file