diff options
Diffstat (limited to 'BKUOnline/src')
-rw-r--r-- | BKUOnline/src/main/java/at/gv/egiz/bku/online/webapp/AppletDispatcher.java | 16 | ||||
-rw-r--r-- | BKUOnline/src/main/webapp/applet.jsp | 5 |
2 files changed, 13 insertions, 8 deletions
diff --git a/BKUOnline/src/main/java/at/gv/egiz/bku/online/webapp/AppletDispatcher.java b/BKUOnline/src/main/java/at/gv/egiz/bku/online/webapp/AppletDispatcher.java index 26349f7c..24938cd5 100644 --- a/BKUOnline/src/main/java/at/gv/egiz/bku/online/webapp/AppletDispatcher.java +++ b/BKUOnline/src/main/java/at/gv/egiz/bku/online/webapp/AppletDispatcher.java @@ -18,8 +18,6 @@ package at.gv.egiz.bku.online.webapp; import java.io.IOException; -import java.io.PrintWriter; -import java.util.regex.Matcher; import java.util.regex.Pattern; import javax.servlet.RequestDispatcher; import javax.servlet.ServletException; @@ -55,14 +53,18 @@ public class AppletDispatcher extends HttpServlet { protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { -// String suffix = (String) request.getSession().getAttribute(RAND_CTX_ATTRIBUTE); -// log.trace("expecting random suffix " + suffix); - String uri = request.getRequestURI(); +// log.trace("request URI " + uri); + + uri = uri.substring(request.getContextPath().length()); +// log.trace("removing contextPath " + uri); + uri = ctxPattern.matcher(uri).replaceAll(""); -// uri = uri.replaceAll(suffix, ""); //only the applet jar requests contains the randCtx - uri = archivePattern.matcher(uri).replaceAll(".jar"); +// log.trace("removing dispatch context " + uri); + uri = archivePattern.matcher(uri).replaceAll(".jar"); +// log.trace("removing random suffix " + uri); + if (log.isTraceEnabled()) { log.trace("dispatching request URI " + request.getRequestURI() + " to " + uri); diff --git a/BKUOnline/src/main/webapp/applet.jsp b/BKUOnline/src/main/webapp/applet.jsp index 6af81578..b2e54673 100644 --- a/BKUOnline/src/main/webapp/applet.jsp +++ b/BKUOnline/src/main/webapp/applet.jsp @@ -44,7 +44,6 @@ String extension = (String) session.getAttribute("extension"); String rand = AppletDispatcher.RAND_PREFIX + RandomStringUtils.randomAlphanumeric(16); - //(String) session.getAttribute(AppletDispatcher.RAND_ATTRIBUTE); String appletClass, appletArchive; if ("activation".equals(extension)) { @@ -64,6 +63,10 @@ document .write('<b>Diese Anwendung benötigt die Java Platform Version 1.6.0_04 oder höher.</b>' + '<input type="submit" value="Java Platform 1.6.0_02 installieren" onclick="deployJava.installLatestJRE();">'); } else { + // to enable applet caching, remove AppletDispatcher servlet, + // change codebase to 'applet', + // remove random suffix for appletArchive + // and remove '../' for all URL applet parameters var attributes = { codebase :'<%="applet/" + AppletDispatcher.DISPATCH_CTX %>', code : '<%=appletClass%>', |