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>
4

2 回答 2

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.

于 2013-05-06T11:04:21.730 回答
0

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

于 2013-05-07T02:00:22.347 回答