<%-- This file generates a dynamic .jnlp file to send the application jar file to the client. It is dynamic in that it creates the name and IP address of the server on which it is running to dynamically set the 'codebase' attribute of the element. It also sends the server IP as an argument to the main class described in the element. The server id is required so that the application will know which CMIB to communicate with. --%> <%-- -- See comments at the bottom of this module regarding these -- header settings --%> <% response.setContentType("application/x-java-jnlp-file"); response.setHeader("Keep-Alive", "time=15, max=100"); response.setHeader("Connection", "Keep-Alive"); /* * Caution. The following will choke if the server is running out * of the .war file. */ java.io.File thisFile = new java.io.File(request.getRealPath("timecodeBoard.jsp")); response.addDateHeader("Last-Modified", thisFile.lastModified()); String serverName = "http://" + request.getServerName(); String serverIp = java.net.InetAddress.getByName (request.getServerName()).getHostAddress(); %> WIDAR Prototype Timecode Board National Radio Astronomy Observatory Timecode Board Screen GUI The GUI for the WIDAR Prototype Timecode Board. <%= serverIp %> <%-- The following response settings were taken from : http://www.jfimagine.com/en/faq.htm#dynamic-jnlp with this explaination: " ... notice to set the header content type of http response as 'application/x-java-jnlp-file'. and the encode type of http response would be 'UTF-8' and, you'd better to the set the http header expires immediately, or please always set a new date-time for the response.So the browser will be forced to fetch jnlp content each time." response.setHeader("Expires", "0"); response.addDateHeader ("Date", java.util.Calendar.getInstance().getTime().getTime()); response.addDateHeader ("Last-Modified", java.util.Calendar.getInstance().getTime().getTime()); [Kev-note] Packet sniffing showed that by using an ever-changing Last-Modified date caused the jnlp file to be re-requested 3 or 4 times by the client for a single JWS launch. Setting the last- modified date to when the file was actually last modified appears to make this work so the file is only transferred once. --%>