Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
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 Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Displaying images from ApplicationResources properties" Watch "Displaying images from ApplicationResources properties" New topic

Displaying images from ApplicationResources properties

Chris Boldon
Ranch Hand

Joined: Aug 10, 2006
Posts: 190
Ok, so I have image locations stored in my 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:

Consultant, Sima Solutions
I agree. Here's the link:
subject: Displaying images from ApplicationResources properties
jQuery in Action, 3rd edition