Bu fonksiyonu ekle.
import java.net.*;
import java.io.*;
public static boolean exists(String URLName){
try {
HttpURLConnection.setFollowRedirects(false);
// note : you may also need
// HttpURLConnection.setInstanceFollowRedirects(false)
HttpURLConnection con =
(HttpURLConnection) new URL(URLName).openConnection();
con.setRequestMethod("HEAD");
return (con.getResponseCode() == HttpURLConnection.HTTP_OK);
}
catch (Exception e) {
e.printStackTrace();
return false;
}
} <img src="#(exists('link/foto/'+${user.employeeNumber}+'.jpg') ? 'link/foto/'+#{user.employeeNumber}+'.jpg' : 'default.jpg' )" class="sdars"/>If'in yazımında hata olabilir, daha önce yazmadım spring, mantık olarak yardımcı olabilir sana.
Koda ulaştığım an ekleyeceğim hocam çok teşekkürler