Go Back   CodingForums.com > :: Server side development > Java and JSP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 09-06-2011, 02:41 PM   PM User | #1
djso1987
New to the CF scene

 
Join Date: Jun 2011
Posts: 7
Thanks: 1
Thanked 0 Times in 0 Posts
djso1987 is an unknown quantity at this point
simple jsp image path

Please see what is wrong with this code.

I want to check if the image is available in the following location ${basePath}images/newcars/assets/75/${vehicle.trimId}.jpg . if the image is available the <img src=””> should be set to this path.
If the image is not available then the <img src=””> should be set to ${basePath}images/common/imagenotavailable70X48.jpg.




<c:choose><c:when test="${thumbpath != null}">
<c:set var="thumbpath" value="${basePath}images/newcars/assets/75/${vehicle.trimId}.jpg" />
</c:when>
<ctherwise>
<c:set var="thumbpath" value="${basePath}images/common/imagenotavailable70X48.jpg" />
</ctherwise></c:choose>

<img src="${thumbpath}" alt="${vehicle.make} ${vehicle.model}" title="${vehicle.make} ${vehicle.model}" width="64" height="48" />
djso1987 is offline   Reply With Quote
Reply

Bookmarks

Tags
chose, cwhen, jsp

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 06:11 PM.


Advertisement
Log in to turn off these ads.