diff options
author | clemenso <clemenso@8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4> | 2009-03-10 10:07:28 +0000 |
---|---|---|
committer | clemenso <clemenso@8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4> | 2009-03-10 10:07:28 +0000 |
commit | f095a6dcd1e36beaf828a7c5da934d7c50529b48 (patch) | |
tree | 7dbe110242793b0875d91d826c02d2aeafec36ea /BKUOnline/src/main/java/at/gv | |
parent | a94eadabb2c0e524023619734ebb88162fb38c5c (diff) | |
download | mocca-f095a6dcd1e36beaf828a7c5da934d7c50529b48.tar.gz mocca-f095a6dcd1e36beaf828a7c5da934d7c50529b48.tar.bz2 mocca-f095a6dcd1e36beaf828a7c5da934d7c50529b48.zip |
AppletPageAlternative
git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@314 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4
Diffstat (limited to 'BKUOnline/src/main/java/at/gv')
-rw-r--r-- | BKUOnline/src/main/java/at/gv/egiz/bku/online/webapp/BKURequestHandler.java | 49 |
1 files changed, 26 insertions, 23 deletions
diff --git a/BKUOnline/src/main/java/at/gv/egiz/bku/online/webapp/BKURequestHandler.java b/BKUOnline/src/main/java/at/gv/egiz/bku/online/webapp/BKURequestHandler.java index 4b275298..68a57fb5 100644 --- a/BKUOnline/src/main/java/at/gv/egiz/bku/online/webapp/BKURequestHandler.java +++ b/BKUOnline/src/main/java/at/gv/egiz/bku/online/webapp/BKURequestHandler.java @@ -81,10 +81,10 @@ public class BKURequestHandler extends SpringBKUServlet { IdFactory.getInstance().createId(session.getId())); if (bp != null) { log.debug("Found binding processor, using this one"); - String appletPage = (String) session.getAttribute(APPLET_PAGE_P); - RequestDispatcher dispatcher = getServletContext().getNamedDispatcher(appletPage); - log.debug("forward to applet " + appletPage); - dispatcher.forward(req, resp); + String appletPage = getStringFromStream( + ((HTTPBindingProcessor) bp).getFormData(APPLET_PAGE_P), + req.getCharacterEncoding()); + getDispatcher(appletPage).forward(req, resp); return; } log.debug("Did not find a binding processor, creating new ..."); @@ -124,14 +124,6 @@ public class BKURequestHandler extends SpringBKUServlet { log.trace("Trying to find applet parameters in request"); - String appletPage = getStringFromStream(bindingProcessor - .getFormData(APPLET_PAGE_P), charset); - if (appletPage == null) { - appletPage = APPLET_PAGE_DEFAULT; - } - log.trace("requested appletPage " + appletPage); - session.setAttribute(APPLET_PAGE_P, appletPage); - String width = getStringFromStream(bindingProcessor .getFormData("appletWidth"), charset); String height = getStringFromStream(bindingProcessor @@ -197,17 +189,10 @@ public class BKURequestHandler extends SpringBKUServlet { log.info("Got redirect URL "+redirectUrl+". Deferring browser redirect."); session.setAttribute(REDIRECT_URL_SESSION_ATTRIBUTE, redirectUrl); } - RequestDispatcher dispatcher = getServletContext().getNamedDispatcher( - appletPage); - if (dispatcher == null) { - log.warn("requested AppletPage " + appletPage + " not configured"); - appletPage = APPLET_PAGE_DEFAULT; - session.setAttribute(APPLET_PAGE_P, APPLET_PAGE_DEFAULT); - dispatcher = getServletContext().getNamedDispatcher( - appletPage); - } - log.debug("forward to applet " + appletPage); - dispatcher.forward(req, resp); + + String appletPage = getStringFromStream(bindingProcessor + .getFormData(APPLET_PAGE_P), charset); + getDispatcher(appletPage).forward(req, resp); } @Override @@ -215,4 +200,22 @@ public class BKURequestHandler extends SpringBKUServlet { throws ServletException, java.io.IOException { doPost(req, resp); } + + private RequestDispatcher getDispatcher(String appletPage) { + RequestDispatcher dispatcher = null; + if (appletPage != null) { + log.trace("requested appletPage " + appletPage); + dispatcher = getServletContext().getNamedDispatcher(appletPage); + } + if (dispatcher == null) { + log.trace("no appletPage requested or appletPage not configured, using default"); + appletPage = APPLET_PAGE_DEFAULT; + dispatcher = getServletContext().getNamedDispatcher(appletPage); + } +// session.setAttribute(APPLET_PAGE_P, appletPage); + log.debug("forward to applet " + appletPage); + + return dispatcher; + } + } |