That's excellent !
Thank you very much
Leonidas
Engelking, Nicholas wrote:
You could create a java File object for and then use an if tag to decide what
to display.
In you action class ...
public File getFile(){
// returns the file list
}
In your template ...
<s:url var=imgUrl value="yourOtherImageFile" />
<s:if test="%{file.exists()}">
<s:url var=imgUrl value="yourImageFile" />
</s:if>
<img href="<s:property value="#imgUrl"/>" />
-----Original Message-----
From: Leonidas Papadakis [mailto:[EMAIL PROTECTED]
Sent: September 20, 2007 4:20 PM
To: Struts Users Mailing List
Subject: check if file exists...
Hi there,
does anyone know in struts2 whether i can test if a file exists from my
template file i.e.
if fileExists(folder/image1) then ... show image1 else show image2
Thanks in advance
Leon
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
********************
NOTICE OF CONFIDENTIALITY
This communication including any information transmitted with it is
intended only for the use of the addressees and is confidential.
If you are not an intended recipient or responsible for delivering
the message to an intended recipient, any review, disclosure,
conversion to hard copy, dissemination, reproduction or other use
of any part of this communication is strictly prohibited, as is the
taking or omitting of any action in reliance upon this communication.
If you receive this communication in error or without authorization
please notify us immediately by return e-mail or otherwise and
permanently delete the entire communication from any computer,
disk drive, or other storage medium.
If the above disclaimer is not properly readable, it can be found at
www.td.com/legal
AVERTISSEMENT DE CONFIDENTIALITE
Ce courriel, ainsi que tout renseignement ci-inclus, destine' uniquement
aux destinataires susmentionne's, est confidentiel. Si vous
n’e^tes pas le destinataire pre'vu ou un agent responsable de la
livraison de ce courriel, tout examen, divulgation, copie, impression,
reproduction, distribution, ou autre utilisation d’une partie de ce
courriel est strictement interdit de me^me que toute intervention ou
abstraction a` cet e'gard. Si vous avez rec,u ce message par erreur ou
sans autorisation, veuillez en aviser imme'diatement l’expe'diteur par
retour de courriel ou par un autre moyen et supprimer imme'diatement
cette communication entie`re de tout syste`me e'lectronique.
Si l'avis de non-responsabilite' ci-dessus n'est pas lisible, vous
pouvez le consulter a` www.td.com/francais/legale
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]