Sophie

Sophie

distrib > Mageia > 2 > i586 > media > core-release-src > by-pkgid > 767b074348ccbf965c159dbd6e3c4cc7 > files > 10

jakarta-commons-jelly-1.0-1.mga2.src.rpm

--- commons-jelly-1.0/jelly-tags/jetty/src/java/org/apache/commons/jelly/tags/jetty/SecurityHandlerTag.java	2005-02-26 14:06:03.000000000 +0100
+++ commons-jelly-1.0/jelly-tags/jetty/src/java/org/apache/commons/jelly/tags/jetty/SecurityHandlerTag.java-gil	2009-07-15 03:42:27.000000000 +0200
@@ -16,6 +16,8 @@
 
 package org.apache.commons.jelly.tags.jetty;
 
+import org.apache.commons.logging.Log;
+
 import org.apache.commons.jelly.JellyTagException;
 import org.apache.commons.jelly.TagSupport;
 import org.apache.commons.jelly.XMLOutput;
@@ -23,11 +25,11 @@
 import org.mortbay.http.BasicAuthenticator;
 import org.mortbay.http.ClientCertAuthenticator;
 import org.mortbay.http.DigestAuthenticator;
-import org.mortbay.http.SecurityConstraint.Authenticator;
+import org.mortbay.http.Authenticator;
 import org.mortbay.http.SecurityConstraint;
 import org.mortbay.http.handler.SecurityHandler;
 import org.mortbay.jetty.servlet.FormAuthenticator;
-import org.mortbay.util.Code;
+import org.mortbay.log.LogFactory;
 import org.mortbay.xml.XmlParser;
 
 import org.xml.sax.InputSource;
@@ -44,6 +46,7 @@
  * @version $Id: SecurityHandlerTag.java 155420 2005-02-26 13:06:03Z dirkv $
  */
 public class SecurityHandlerTag extends TagSupport {
+    private Log log = LogFactory.getLog(SecurityHandlerTag.class);
 
     /** a form authenticator used by this tag */
     private transient FormAuthenticator _formAuthenticator;
@@ -158,6 +161,7 @@
     */
     protected void initSecurityConstraint(XmlParser.Node node,
                                           HttpContextTag httpContext)
+                                          throws JellyTagException
     {
         SecurityConstraint scBase = new SecurityConstraint();
 
@@ -188,7 +192,7 @@
                 scBase.setDataConstraint(SecurityConstraint.DC_CONFIDENTIAL);
             else
             {
-                Code.warning("Unknown user-data-constraint:"+guarantee);
+                log.warn("Unknown user-data-constraint:"+guarantee);
                 scBase.setDataConstraint(SecurityConstraint.DC_CONFIDENTIAL);
             }
         }
@@ -198,7 +202,12 @@
         {
             XmlParser.Node collection=(XmlParser.Node)iter.next();
             String name=collection.getString("web-resource-name",false,true);
-            SecurityConstraint sc = (SecurityConstraint)scBase.clone();
+            SecurityConstraint sc = null;
+            try {
+                sc = (SecurityConstraint)scBase.clone();
+            } catch(CloneNotSupportedException cnse) {
+                throw new JellyTagException(cnse);
+            }
             sc.setName(name);
 
             Iterator iter2= collection.iterator("http-method");
@@ -245,7 +254,7 @@
             else if (SecurityConstraint.__CERT_AUTH.equals(m))
                 authenticator=new ClientCertAuthenticator();
             else
-                Code.warning("UNKNOWN AUTH METHOD: "+m);
+                log.warn("UNKNOWN AUTH METHOD: "+m);
 
             httpContext.setAuthenticator(authenticator);
         }
@@ -258,7 +267,7 @@
         if(formConfig != null)
         {
             if (_formAuthenticator==null)
-                Code.warning("FORM Authentication miss-configured");
+                log.warn("FORM Authentication miss-configured");
             else
             {
                 XmlParser.Node loginPage = formConfig.get("form-login-page");