Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Licensed to the Apache Software Foundation (ASF) under one or more
   * contributor license agreements.  See the NOTICE file distributed with
   * this work for additional information regarding copyright ownership.
   * The ASF licenses this file to You under the Apache License, Version 2.0
   * (the "License"); you may not use this file except in compliance with
   * the License.  You may obtain a copy of the License at
   * 
   *      http://www.apache.org/licenses/LICENSE-2.0
  * 
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
 
 
 package org.apache.catalina.deploy;
 
 
 
 
Representation of a login configuration element for a web application, as represented in a <login-config> element in the deployment descriptor.

Author(s):
Craig R. McClanahan
Version:
$Revision: 1237 $ $Date: 2009-11-03 02:55:48 +0100 (Tue, 03 Nov 2009) $
 
 
 public class LoginConfig implements Serializable {
 
 
     // ----------------------------------------------------------- Constructors
 

    
Construct a new LoginConfig with default properties.
 
     public LoginConfig() {
 
         super();
 
     }


    
Construct a new LoginConfig with the specified properties.

Parameters:
authMethod The authentication method
realmName The realm name
loginPage The login page URI
errorPage The error page URI
 
     public LoginConfig(String authMethodString realmName,
                        String loginPageString errorPage) {
 
         super();
         setAuthMethod(authMethod);
         setRealmName(realmName);
         setLoginPage(loginPage);
         setErrorPage(errorPage);
 
     }
 
 
     // ------------------------------------------------------------- Properties
 

    
The authentication method to use for application login. Must be BASIC, DIGEST, FORM, or CLIENT-CERT.
 
     private String authMethod = null;
 
     public String getAuthMethod() {
         return (this.);
     }
 
     public void setAuthMethod(String authMethod) {
         if (authMethod == null) {
             this. = .;
         } else {
             this. = authMethod;
         }
     }


    
The context-relative URI of the error page for form login.
 
     private String errorPage = null;
    public String getErrorPage() {
        return (this.);
    }
    public void setErrorPage(String errorPage) {
        //        if ((errorPage == null) || !errorPage.startsWith("/"))
        //            throw new IllegalArgumentException
        //                ("Error Page resource path must start with a '/'");
        this. = RequestUtil.URLDecode(errorPage);
    }


    
The context-relative URI of the login page for form login.
    private String loginPage = null;
    public String getLoginPage() {
        return (this.);
    }
    public void setLoginPage(String loginPage) {
        //        if ((loginPage == null) || !loginPage.startsWith("/"))
        //            throw new IllegalArgumentException
        //                ("Login Page resource path must start with a '/'");
        this. = RequestUtil.URLDecode(loginPage);
    }


    
The realm name used when challenging the user for authentication credentials.
    private String realmName = null;
    public String getRealmName() {
        return (this.);
    }
    public void setRealmName(String realmName) {
        this. = realmName;
    }
    // --------------------------------------------------------- Public Methods


    
Return a String representation of this object.
    public String toString() {
        StringBuilder sb = new StringBuilder("LoginConfig[");
        sb.append("authMethod=");
        sb.append();
        if ( != null) {
            sb.append(", realmName=");
            sb.append();
        }
        if ( != null) {
            sb.append(", loginPage=");
            sb.append();
        }
        if ( != null) {
            sb.append(", errorPage=");
            sb.append();
        }
        sb.append("]");
        return (sb.toString());
    }
New to GrepCode? Check out our FAQ X