This week's book giveaway is in the Performance forum.
We're giving away four copies of The Java Performance Companion and have Charlie Hunt, Monica Beckwith, Poonam Parhar, & Bengt Rutisson on-line!
See this thread for details.
Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Displaying images from ApplicationResources properties

 
Chris Boldon
Ranch Hand
Posts: 190
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok, so I have image locations stored in my ApplicationResources.properties file so it's easy to swap the images out. Displaying the images directly in a jsp is simple:



Now lets say I want to make a calculation in the business logic and return a value, either red, yellow, or green. Then have the the propery color icon displayed on the jsp. Scriptlets cannot be used or it would be easy to simply include an if statement.

How would you handle this, keeping as much out of the JSP as possible?
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'd suggest putting this logic in the getter method of a JavaBean. Example:
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic