0

I want to make a tooltip using an anchor tag with the text coming from a properties file.

How do I get this text from application.properties to the anchor's title attribute?

msg.delete=click to delete this item.

JSP

<a title="{tooltips.delete}" href="do something">
  <img src="../images/delete_icon.png">
</a>
Kenny Linsky
  • 1,726
  • 3
  • 17
  • 41
kitokid
  • 3,009
  • 17
  • 65
  • 101

2 Answers2

0

use ResourceBundle inside jsp to get value from properties file. use $ operator to fetch corresponding value for your key.

i.e tooltips.delete = User will be deteled (entry in application.properites)

<a title="${tooltips.delete}" href="do something">

use This stackoverflow question to resolve your issue. Even though question is about Internationalization you can learn from it to read properties file and place value inside href.

Community
  • 1
  • 1
Alpesh Gediya
  • 3,706
  • 1
  • 25
  • 38
0

Finally, able to solve it using s text like title="<s:text name="tooltips.delete"/>".

kitokid
  • 3,009
  • 17
  • 65
  • 101