<%@page import="java.io.File" %> <%@page import="java.io.InputStream" %> <%@page import="java.util.Properties" %> <% String uri = request.getRequestURI(); int start = uri.lastIndexOf("/")+1; int end = uri.indexOf("?"); String pageName = uri.substring(start); if(end > 0) { pageName = uri.substring(start,end); } String folder = "/resources"; String image = folder+"/UIMA_banner2tlpTm.png"; try { InputStream stream = application.getResourceAsStream(folder+"/image-map.properties"); Properties props = new Properties(); props.load(stream); String value = props.getProperty(pageName); if(value != null) { value = value.trim(); if(value.length() > 0) { String fileName = value; if(!fileName.startsWith(File.pathSeparator)) { fileName = application.getRealPath(value); } File file = new File(fileName); if(file.exists()) { image = value; } } } } catch(Exception e) { } %>