Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Java and JDK > JSP Basics
|
JSP Basics Beginning-level questions on JSP. More advanced coders should post to Pro JSP.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the JSP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 30th, 2006, 10:55 PM
Registered User
 
Join Date: Jul 2006
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to mcw22
Default Imposing Image Conditions

I am still new to JSP and I need some help on how to implement two more conditions to this exisiting chunk of code (see below). My intention is to impose three conditions in which the image will load.

<tr>
<td width="100%" align="center">
<% if (patron != null) { %>
<% if ((patron.getImage() == null) || (patron.getImage().equals(""))) { %>
<img src="../photos/replacement.gif">
  <% } else { %>
<img alt="<%=patron.getImage() %>" src="../../elmu/index.jsp?module=ROOT&action=photo.jsp&id=<%=user. getPatronId()%>">
<% }
}
%>
</td>
</tr>

This is one of the conditions that i've imposed.

1.The first condition is where replacement.gif will be loaded if the value of the data in the column (in database) is either null or blank. Otherwise, it will go to the picture directory and opens the file.
2. The second one that I want to implement is whereby it checks for the existence of the file and if it doesn't exist then it returns replacement.gif.
3. The third one is reading the types of file accepted. If the file format is not (png, gif, or jpeg), then replacement.gif will be loaded.

I need help on implementing the last two conditions. Any help would be beneficial. Thank you.

Keep doing more...:)





Similar Threads
Thread Thread Starter Forum Replies Last Post
Removing whitespaces with certain conditions trishla XSLT 16 October 4th, 2007 05:35 PM
Multiple conditions austinf XSLT 1 May 5th, 2006 02:55 AM
Multiple conditions austinf XSLT 1 May 5th, 2006 02:38 AM
Conditions in looping sridevi XSLT 0 July 31st, 2004 06:11 AM
calling functions with conditions Toka1 Javascript How-To 2 February 5th, 2004 09:29 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.