Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
swapnil dangore
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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...
 
swapnil dangore
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic