• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Prevent Struts2 escaping html in labels?

 
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all.

I'd like to use a jquery-ui icon on a struts2 button to add a bit of visual flair to an app. The code in the jsp looks something like:

And my application.properties text is:

This almost does what I'd like, except somewhere along the line the html in the message has been escaped. The html generated looks like:

Any ideas what is doing the escaping and how to stop it? Or if anyone has done what I'm attempting and has a better way of doing it (preferably that will allow adding icons to buttons to be made via application.properties changes only)
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You might have to change the template or use normal CSS. The current "xhtml" theme templates (css_xhtml might be a little better, I know someone made some enhancements to it) aren't super-good at exposing ids/classes to CSS.

All that said I'd really recommend against putting markup stuff in resource files unless there's a *really* good reason to do so. Since the label field would be accessible using straight CSS I don't think this is one of the places where it'd be necessary.
 
CLUCK LIKE A CHICKEN! Now look at this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic