JSP – Checking if a file exists. 2018-01-04 這個 sample code 滿簡單的: ServletContext app = getServletContext(); String path = app.getRealPath("/"); File theFile = new File(path + "/images/your-file.jpg"); out.print("File Exists: " + theFile.exists() + "<br/>");
Tomcat version 9.0 only supports J2EE 1.2, 1.3, 1.4, and Java EE 5, 6, 7, and 8 Web modules 2024-04-30