This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile 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