geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r684883 - in /geronimo/sandbox/djencks/jetty7: geronimo-jetty7-builder/src/main/java/org/apache/geronimo/jetty7/deployment/JettyModuleBuilder.java geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/security/auth/FormAuthModule.java
Date Mon, 11 Aug 2008 19:23:28 GMT
Author: djencks
Date: Mon Aug 11 12:23:28 2008
New Revision: 684883

URL: http://svn.apache.org/viewvc?rev=684883&view=rev
Log:
use forward rather than redirect for login page.  Use correct deployment context for auth
gbeans

Modified:
    geronimo/sandbox/djencks/jetty7/geronimo-jetty7-builder/src/main/java/org/apache/geronimo/jetty7/deployment/JettyModuleBuilder.java
    geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/security/auth/FormAuthModule.java

Modified: geronimo/sandbox/djencks/jetty7/geronimo-jetty7-builder/src/main/java/org/apache/geronimo/jetty7/deployment/JettyModuleBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/jetty7/geronimo-jetty7-builder/src/main/java/org/apache/geronimo/jetty7/deployment/JettyModuleBuilder.java?rev=684883&r1=684882&r2=684883&view=diff
==============================================================================
--- geronimo/sandbox/djencks/jetty7/geronimo-jetty7-builder/src/main/java/org/apache/geronimo/jetty7/deployment/JettyModuleBuilder.java
(original)
+++ geronimo/sandbox/djencks/jetty7/geronimo-jetty7-builder/src/main/java/org/apache/geronimo/jetty7/deployment/JettyModuleBuilder.java
Mon Aug 11 12:23:28 2008
@@ -480,7 +480,7 @@
             }
 
             // configure login configs.
-            configureLoginConfigs(earContext, module, webApp, jettyWebApp, webModuleData);
+            configureAuthentication(module, webApp, jettyWebApp, webModuleData);
 
             // Make sure that servlet mappings point to available servlets and never add
a duplicate pattern.
 
@@ -770,7 +770,8 @@
         }
     }
 
-    private void configureLoginConfigs(EARContext moduleContext, Module module, WebAppType
webApp, JettyWebAppType jettyWebApp, GBeanData webModuleData) throws DeploymentException,
GBeanAlreadyExistsException {
+    private void configureAuthentication(Module module, WebAppType webApp, JettyWebAppType
jettyWebApp, GBeanData webModuleData) throws DeploymentException, GBeanAlreadyExistsException
{
+        EARContext moduleContext = module.getEarContext();
         LoginConfigType[] loginConfigArray = webApp.getLoginConfigArray();
         if (loginConfigArray.length > 1) {
             throw new DeploymentException("Web app " + module.getName() + " cannot have more
than one login-config element.  Currently has " + loginConfigArray.length + " login-config
elements.");

Modified: geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/security/auth/FormAuthModule.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/security/auth/FormAuthModule.java?rev=684883&r1=684882&r2=684883&view=diff
==============================================================================
--- geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/security/auth/FormAuthModule.java
(original)
+++ geronimo/sandbox/djencks/jetty7/geronimo-jetty7/src/main/java/org/apache/geronimo/jetty7/security/auth/FormAuthModule.java
Mon Aug 11 12:23:28 2008
@@ -39,6 +39,8 @@
 import javax.servlet.http.HttpSession;
 import javax.servlet.http.HttpSessionBindingEvent;
 import javax.servlet.http.HttpSessionBindingListener;
+import javax.servlet.RequestDispatcher;
+import javax.servlet.ServletException;
 
 import org.mortbay.jetty.security.Constraint;
 import org.mortbay.jetty.security.CrossContextPsuedoSession;
@@ -296,9 +298,11 @@
                             "://" + request.getServerName() +
                             ":" + request.getServerPort() +
                             URIUtil.addPaths(request.getContextPath(), uri));
-            response.setContentLength(0);
-            response.sendRedirect(response.encodeRedirectURL(URIUtil.addPaths(request.getContextPath(),
-                    _formLoginPage)));
+//            response.setContentLength(0);
+//            response.sendRedirect(response.encodeRedirectURL(URIUtil.addPaths(request.getContextPath(),
+//                    _formLoginPage)));
+            RequestDispatcher dispatcher = request.getRequestDispatcher(_formLoginPage);
+            dispatcher.forward(request, response);
             return AuthStatus.SEND_CONTINUE;
         }
         catch (IOException e)
@@ -308,6 +312,8 @@
         catch (UnsupportedCallbackException e)
         {
             throw new AuthException(e.getMessage());
+        } catch (ServletException e) {
+            throw new AuthException(e.getMessage());
         }
 
     }



Mime
View raw message