tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Arieh Markel <Arieh.Mar...@Central.Sun.COM>
Subject PATCH for context.WebXmlInterceptor, core.Context (was Re: login-config handling)
Date Fri, 11 Feb 2000 16:04:23 GMT

> Mailing-List: contact tomcat-dev-help@jakarta.apache.org; run by ezmlm
> X-No-Archive: yes
> list-help: <mailto:tomcat-dev-help@jakarta.apache.org>
> list-unsubscribe: <mailto:tomcat-dev-unsubscribe@jakarta.apache.org>
> list-post: <mailto:tomcat-dev@jakarta.apache.org>
> Delivered-To: mailing list tomcat-dev@jakarta.apache.org
> From: costin@eng.sun.com
> To: tomcat-dev@jakarta.apache.org
> Subject: Re: login-config handling
> 
> > > Also, I see that the Context class does not have a placeholder for the
> > > LoginConfiguration information.
> > 
> > Yes. If it isn't working, the context doesn't know about it :-)
> 
> I'll fix that tommorow, it's easy.
> 
> Costin
> 

Here is the first part (my try of the initial incorporation into
WebXmlInterceptor, Context).

Diffs are relative to 3.1M1.

What's left is to develop the code that know what to do with it ;).

Arieh

===========================================================================
--- 
/home/amarkel/src/jakarta-tomcat/src/share/org/apache/tomcat/core/Context.java	
Fri Feb 11 08:59:17 2000
+++ ./Context.java	Thu Feb 10 17:47:19 2000
@@ -63,6 +63,7 @@
 import org.apache.tomcat.server.*;
 import org.apache.tomcat.context.*;
 import org.apache.tomcat.util.*;
+import org.apache.tomcat.deployment.LoginConfiguration;
 import java.io.*;
 import java.net.*;
 import java.util.*;
@@ -144,6 +145,7 @@
     private boolean isDistributable = false;
     private MimeMap mimeTypes = new MimeMap();
     private int sessionTimeOut = -1;
+    private LoginConfiguration loginConfig = null;
 
     // Maps specified in web.xml ( String->ServletWrapper )
     private Hashtable prefixMappedServlets = new Hashtable();
@@ -1074,6 +1076,28 @@
 
     public void addLibPath(String path) {
         this.libPaths.addElement(path);
+    }
+
+    /**  get the LoginConfiguration object associated with this context
+     *
+     *  Based on Java Servlet Specification 2.2, chapter 13.
+     *  See login-config element.
+     *
+     *  @return the LoginConfiguration associated.
+     */
+    public LoginConfiguration getLoginConfiguration() {
+	return loginConfig;
+    }
+
+    /**  set the LoginConfiguration object associated with this context
+     *
+     *  Based on Java Servlet Specification 2.2, chapter 13.
+     *  See login-config element.
+     *
+     *  @param conf the LoginConfiguration to be associated with this context.
+     */
+    public void setLoginConfiguration(LoginConfiguration conf) {
+	loginConfig= conf;
     }
 
     // XXX XXX XXX ugly, need rewrite ( servletLoader will call getClassPaths 
and getLibPaths
===========================================================================
--- 
/home/amarkel/src/jakarta-tomcat/src/share/org/apache/tomcat/context/WebXmlInter
ceptor.java	Fri Feb 11 08:59:45 2000
+++ ../context/WebXmlInterceptor.java	Thu Feb 10 17:51:29 2000
@@ -74,6 +74,7 @@
  * Will configure the context using the default web.xml
  *
  * @author costin@dnt.ro
+ * @author arieh.markel@sun.com
  */
 public class WebXmlInterceptor implements ContextInterceptor {
     private static StringManager sm 
=StringManager.getManager("org.apache.tomcat.core");
@@ -158,6 +159,7 @@
 		processWelcomeFiles(ctx, webDescriptor.getWelcomeFiles(),
 				    internal);
 		processErrorPages(ctx, webDescriptor.getErrorPageDescriptors());
+		processLoginConfig(ctx, webDescriptor.getLoginConfiguration());
 	    } catch (Throwable e) {
                 String msg = "config parse: " + e.getMessage();
 
@@ -333,5 +335,15 @@
 	}
     }
 
+    /**  handler for processing Login Configuration
+     *
+     *  @param ctx the context for which we are updating the login config
+     *  @param cf the LoginConfiguration information that is to be associated
+     *		  with the context passed
+     */
+    private void processLoginConfig(Context ctx, LoginConfiguration cf) {
+	if (null != cf)
+	    ctx.setLoginConfiguration(cf);
+    }
     
 }


--
 Arieh Markel		                Sun Microsystems Inc.
 Network Storage                        500 Eldorado Blvd. MS UBRM11-194
 e-mail: arieh.markel@sun.COM           Broomfield, CO 80021
 Let's go Panthers !!!!                 Phone: (303) 272-8547 x78547
 (e-mail me with subject SEND PUBLIC KEY to get public key)


Mime
View raw message