This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes JSP and the fly likes Dynamic values for HTML-element attributes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Dynamic values for HTML-element attributes" Watch "Dynamic values for HTML-element attributes" New topic
Author

Dynamic values for HTML-element attributes

Paul Bruynel
Greenhorn

Joined: Jan 23, 2004
Posts: 1

Instead of using hard coded strings for HTML-attributes I'd like to assign values dynamically. For instance I would like to keep values for tooltips in a separate properties-file and refer to these in the title-attribute of a HTML-element. I'm using JSPs, and I don't want to use javascript.
If this is possible, can anyone tell me how I can do this?
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
If you plan on doing this on the client, you have to use JavaScript.

If you want to add the title attribute onto the elements from the server as the page is rendered, than this should be moved into another section of the ranch that deals with the serverside.

Eric
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61456
    
  67

Check out the <fmt:message> tag of the JSTL.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Dynamic values for HTML-element attributes