wood burning stoves 2.0*
The moose likes Struts and the fly likes Displaying images from ApplicationResources properties 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 » Frameworks » Struts
Bookmark "Displaying images from ApplicationResources properties" Watch "Displaying images from ApplicationResources properties" New topic
Author

Displaying images from ApplicationResources properties

Chris Boldon
Ranch Hand

Joined: Aug 10, 2006
Posts: 190
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

Joined: Feb 15, 2005
Posts: 4864
I'd suggest putting this logic in the getter method of a JavaBean. Example:


Merrill
Consultant, Sima Solutions
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Displaying images from ApplicationResources properties