You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2002/02/12 07:10:42 UTC

cvs commit: jakarta-tomcat-4.0/webapps/admin/realm jdbcRealm.jsp jndiRealm.jsp memoryRealm.jsp userDBRealm.jsp

manveen     02/02/11 22:10:42

  Modified:    webapps/admin/WEB-INF struts-config.xml
               webapps/admin/WEB-INF/classes/org/apache/webapp/admin
                        ApplicationResources_en.properties
                        ApplicationResources_es.properties
  Added:       webapps/admin/WEB-INF/classes/org/apache/webapp/admin/realm
                        JNDIRealmAction.java JNDIRealmForm.java
                        SetUpJNDIRealmAction.java
               webapps/admin/realm jdbcRealm.jsp jndiRealm.jsp
                        memoryRealm.jsp userDBRealm.jsp
  Removed:     webapps/admin jdbcRealm.jsp memoryRealm.jsp userDBRealm.jsp
  Log:
  *Added functionality to display and edit JNDI realm properties through the admin tool.
  * Commented out actions that are not yet implemented.
  * Updated the properties files to include properties for JNDI.
  
  Revision  Changes    Path
  1.28      +29 -7     jakarta-tomcat-4.0/webapps/admin/WEB-INF/struts-config.xml
  
  Index: struts-config.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/webapps/admin/WEB-INF/struts-config.xml,v
  retrieving revision 1.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- struts-config.xml	10 Feb 2002 08:06:20 -0000	1.27
  +++ struts-config.xml	12 Feb 2002 06:10:41 -0000	1.28
  @@ -55,6 +55,10 @@
       <form-bean      name="jdbcRealmForm"
                       type="org.apache.webapp.admin.realm.JDBCRealmForm"/>
   
  +    <!-- JNDI Realm form bean -->
  +    <form-bean      name="jndiRealmForm"
  +                    type="org.apache.webapp.admin.realm.JNDIRealmForm"/>
  +
       <!-- Memory Realm form bean -->
       <form-bean      name="memoryRealmForm"
                       type="org.apache.webapp.admin.realm.MemoryRealmForm"/>
  @@ -158,15 +162,19 @@
                   redirect="false"/>
   
       <forward        name="JDBCRealm"
  -                    path="/jdbcRealm.jsp"
  +                    path="/realm/jdbcRealm.jsp"
  +                redirect="false"/>
  +                
  +    <forward        name="JNDIRealm"
  +                    path="/realm/jndiRealm.jsp"
                   redirect="false"/>
                   
       <forward        name="MemoryRealm"
  -                    path="/memoryRealm.jsp"
  +                    path="/realm/memoryRealm.jsp"
                   redirect="false"/>
   
       <forward        name="UserDBRealm"
  -                    path="/userDBRealm.jsp"
  +                    path="/realm/userDBRealm.jsp"
                   redirect="false"/>
   
   
  @@ -338,7 +346,14 @@
                  scope="session">
       </action>
           
  -    <!-- Set up Realm datastructure -->
  +   <!-- Set up JNDI Realm datastructure -->
  +    <action    path="/setUpJNDIRealm"
  +               type="org.apache.webapp.admin.realm.SetUpJNDIRealmAction"
  +               name="jndiRealmForm"
  +               scope="session">
  +    </action>
  +        
  +    <!-- Set up User darabase Realm datastructure -->
       <action    path="/setUpUserDBRealm"
                  type="org.apache.webapp.admin.realm.SetUpUserDBRealmAction"
                  name="userdbRealmForm"
  @@ -431,21 +446,28 @@
                  type="org.apache.webapp.admin.realm.JDBCRealmAction"
                  name="jdbcRealmForm"
                  scope="session"               
  -               input="/jdbcRealm.jsp"/>
  +               input="/realm/jdbcRealm.jsp"/>
  +
  +    <!-- JNDI realm action -->
  +    <action    path="/JNDIRealm"
  +               type="org.apache.webapp.admin.realm.JNDIRealmAction"
  +               name="jndiRealmForm"
  +               scope="session"               
  +               input="/realm/jndiRealm.jsp"/>
   
       <!-- Memory realm action -->
       <action    path="/MemoryRealm"
                  type="org.apache.webapp.admin.realm.MemoryRealmAction"                        
                  name="memoryRealmForm"
                  scope="session"
  -               input="/memoryRealm.jsp"/>
  +               input="/realm/memoryRealm.jsp"/>
                  
       <!-- UserDB realm action -->
       <action    path="/UserDBRealm"
                  type="org.apache.webapp.admin.realm.UserDBRealmAction"             
                  name="userdbRealmForm"
                  scope="session"
  -               input="/userDBRealm.jsp"/>
  +               input="/realm/userDBRealm.jsp"/>
   
   
       <!-- ========== User Database Module ========== -->
  
  
  
  1.27      +20 -0     jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/ApplicationResources_en.properties
  
  Index: ApplicationResources_en.properties
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/ApplicationResources_en.properties,v
  retrieving revision 1.26
  retrieving revision 1.27
  diff -u -r1.26 -r1.27
  --- ApplicationResources_en.properties	11 Feb 2002 23:18:09 -0000	1.26
  +++ ApplicationResources_en.properties	12 Feb 2002 06:10:41 -0000	1.27
  @@ -170,6 +170,16 @@
   realm.userTable=User Table
   realm.resource=Resource Name
   realm.pathName=Path Name
  +realm.connName=Connection Name
  +realm.connPassword=Connection Password
  +realm.connURL=Connection URL
  +realm.connFactory=Context Factory
  +realm.roleBase=Role Base Element
  +realm.Attribute=Role Name Attribute
  +realm.pattern=Role Search Pattern
  +realm.search=Search Subtrees
  +realm.userPassword=User Password
  +realm.userPattern=User Search pattern
   error.resource.required=<li>Resource Name is required.</li>
   error.resource.javaprefix=<li>Resource must have "java:" prefix.</li>
   error.pathName.required=<li>Path Name is required.</li>
  @@ -181,6 +191,16 @@
   error.connectionPassword.required=<li>Database password is required.</li>
   error.connectionURL.required=<li>Database URL is required.</li>
   error.connectionName.required=<li>Database username is required.</li>
  +error.roleAttribute.required=<li>Role name attribute is required.</li>
  +error.digest.required=<li>Digest algorithm is required.</li>
  +error.roleBase.required=<li>Role base element is required.</li>
  +error.rolePattern.required=<li>Role search pattern is required.</li>
  +error.userPassword.required=<li>User Password is required.</li>
  +error.userPattern.required=<li>User search pattern is required.</li>
  +error.contextFactory.required=<li>Context Factory is required.</li>
  +error.connPassword.required=<li>Connection password is required.</li>
  +error.connURL.required=<li>Connection URL is required.</li>
  +error.connName.required=<li>Connection name is required.</li>
   
   # ---------- User Database Module ----------
   users.actions.group.create=Create New Group
  
  
  
  1.26      +35 -14    jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/ApplicationResources_es.properties
  
  Index: ApplicationResources_es.properties
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/ApplicationResources_es.properties,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- ApplicationResources_es.properties	11 Feb 2002 23:18:09 -0000	1.25
  +++ ApplicationResources_es.properties	12 Feb 2002 06:10:41 -0000	1.26
  @@ -170,6 +170,16 @@
   realm.userTable=Vector De Utilizador
   realm.resource=Nombre Del Recurso
   realm.pathName=Nombre Del Path
  +realm.connName=Nombre De la Conexion
  +realm.connPassword=Palabra de paso De la Conexion
  +realm.connURL=URL De la Conexion
  +realm.connFactory=Fabrica Del Contexto
  +realm.roleBase=Elemento Bajo Del Papel
  +realm.Attribute=Role Name Attribute
  +realm.pattern=Modelo De la Busqueda Del Papel
  +realm.search=Search Subtrees
  +realm.userPassword=Palabra de paso Del Utilizador
  +realm.userPattern=User Search pattern
   error.resource.required=<li>Se requiere el nombre del recurso.</li>
   error.resource.javaprefix=<li>El recurso debe tener prefijo de "java:"</li>
   error.pathName.required=<li>Se requiere el nombre del path.</li>
  @@ -181,6 +191,16 @@
   error.connectionPassword.required=<li>Se requiere la palabra de paso de la base de datos.</li>
   error.connectionURL.required=<li>Se requiere el URL de la base de datos.</li>
   error.connectionName.required=<li>Se requiere el username de la base de datos.</li>
  +error.roleAttribute.required=<li>Se requiere el atributo del nombre del role.</li>
  +error.digest.required=<li>Se requiere el algoritmo del digest</li>
  +error.roleBase.required=<li>Se requiere el elemento bajo del papel.</li>
  +error.rolePattern.required=<li>Se requiere el modelo de la busqueda del papel.</li>
  +error.userPassword.required=<li>Se requiere la palabra de paso del utilizador.</li>
  +error.userPattern.required=<li>Se requiere el modelo de la busqueda del utilizador.</li>
  +error.contextFactory.required=<li>Se requiere la factory del contexto.</li>
  +error.connPassword.required=<li>Se requiere la palabra de paso de la conexion.</li>
  +error.connURL.required=<li>Se requiere el URL de la conexion.</li>
  +error.connName.required=<li>Se requiere el nombre de conexion.</li>
   
   # ---------- User Database Module ----------
   users.actions.group.create=Cree Al Nuevo Grupo
  @@ -190,9 +210,9 @@
   users.actions.role.delete=Roles Existentes De la Cancelacion
   users.actions.role.list=Roles Existentes De la Lista
   users.actions.user.create=Cree Al Nuevo Utilizador
  -users.actions.user.delete=Delete Existing Users
  +users.actions.user.delete=Utilizadores Existentes De la Cancelacion
   users.actions.user.list=List Existing Users
  -users.deleteGroups.title=Delete Existing Groups
  +users.deleteGroups.title=Grupos Existentes De la Cancelacion
   users.deleteRoles.title=Delete Existing Roles
   users.deleteUsers.title=Delete Existing Users
   users.error.attribute.get=Error retrieving attribute {0}
  @@ -204,31 +224,32 @@
   users.error.rolename.required=Se requiere el nombre del role
   users.error.token=Sometido transaccion fuera de servicio
   users.error.username.required=Se requiere el nombre del utilizador
  -users.group.newGroup=Create New Group Properties
  -users.group.oldGroup=Edit Existing Group Properties
  -users.group.properties=Group Properties
  +users.group.newGroup=Cree Las Nuevas Properties Del Grupo
  +users.group.oldGroup=Corrija Las Properties Existentes Del Grupo
  +users.group.properties=Properties del Grupo
   users.list.description=Descripcion
   users.list.fullName=Completo Nombre
   users.list.groupname=Nombre De Grupo
   users.list.rolename=Nombre Del Role
   users.list.username=Nombre Del Utilizador
   users.listGroups.title=Lista De los Grupos
  -users.listRoles.title=Roles List
  -users.listUsers.title=Users List
  -users.prompt.description=Description:
  +users.listRoles.title=Lista De los Roles
  +users.listUsers.title=Lista De Utilizadores
  +users.prompt.description=Descripcion:
   users.prompt.fullName=Completo Nombre:
   users.prompt.groupname=Nombre De Grupo:
   users.prompt.password=Palabra de paso:
   users.prompt.rolename=Nombre Del Role:
   users.prompt.username=Nombre Del Utilizador:
  -users.role.newRole=Cree Las Nuevas Caracter�sticas Del Role
  -users.role.oldRole=Edit Existing Role Properties
  -users.role.properties=Role Properties
  +users.role.newRole=Cree Las Nuevas Caracteristicas Del Role
  +users.role.oldRole=Corrija Las Caracteristicas Existentes Del Role
  +users.role.properties=Properties Del Role
   users.treeBuilder.groupsNode=Administracion Del Grupo
   users.treeBuilder.rolesNode=Role Administration
   users.treeBuilder.subtreeNode=User and Group Administration
   users.treeBuilder.usersNode=User Administration
  -users.user.newUser=Create New User Properties
  -users.user.oldUser=Edit Existing User Properties
  -users.user.properties=User Properties
  +users.user.newUser=Cree Las Nuevas Properties Del Utilizador
  +users.user.oldUser=Corrija Las Properties Existentes Del Utilizador
  +users.user.properties=Properties Del Utilizador
   # ---------- -------------------- ----------
  +
  
  
  
  1.1                  jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/realm/JNDIRealmAction.java
  
  Index: JNDIRealmAction.java
  ===================================================================
  /*
   * $Header: /home/cvs/jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/realm/JNDIRealmAction.java,v 1.1 2002/02/12 06:10:41 manveen Exp $
   * $Revision: 1.1 $
   * $Date: 2002/02/12 06:10:41 $
   *
   * ====================================================================
   *
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2001 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution, if
   *    any, must include the following acknowlegement:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowlegement may appear in the software itself,
   *    if and wherever such third-party acknowlegements normally appear.
   *
   * 4. The names "The Jakarta Project", "Struts", and "Apache Software
   *    Foundation" must not be used to endorse or promote products derived
   *    from this software without prior written permission. For written
   *    permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache"
   *    nor may "Apache" appear in their names without prior written
   *    permission of the Apache Group.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   *
   */
  
  package org.apache.webapp.admin.realm;
  
  import java.util.Iterator;
  import java.util.Locale;
  import java.io.IOException;
  import javax.servlet.ServletException;
  import javax.servlet.http.HttpServletRequest;
  import javax.servlet.http.HttpServletResponse;
  import org.apache.struts.action.Action;
  import org.apache.struts.action.ActionErrors;
  import org.apache.struts.action.ActionForm;
  import org.apache.struts.action.ActionForward;
  import org.apache.struts.action.ActionMapping;
  import javax.management.Attribute;
  import javax.management.MBeanServer;
  import javax.management.MBeanServerFactory;
  import javax.management.QueryExp;
  import javax.management.Query;
  import javax.management.ObjectInstance;
  import javax.management.ObjectName;
  import javax.management.JMException;
  import javax.management.MBeanAttributeInfo;
  import javax.management.MBeanOperationInfo;
  import javax.management.MBeanInfo;
  import org.apache.struts.util.MessageResources;
  
  import org.apache.webapp.admin.ApplicationServlet;
  import org.apache.webapp.admin.LabelValueBean;
  
  /**
   * Implementation of <strong>Action</strong> that validates
   * actions on a JNDI Realm.
   *
   * @author Manveen Kaur
   * @version $Revision: 1.1 $ $Date: 2002/02/12 06:10:41 $
   */
  
  public final class JNDIRealmAction extends Action {
      
      private static MBeanServer mBServer = null;
      
      /**
       * The MessageResources we will be retrieving messages from.
       */
      private MessageResources resources = null;
      
      // --------------------------------------------------------- Public Methods
      
      
      /**
       * Process the specified HTTP request, and create the corresponding HTTP
       * response (or forward to another web component that will create it).
       * Return an <code>ActionForward</code> instance describing where and how
       * control should be forwarded, or <code>null</code> if the response has
       * already been completed.
       *
       * @param mapping The ActionMapping used to select this instance
       * @param actionForm The optional ActionForm bean for this request (if any)
       * @param request The HTTP request we are processing
       * @param response The HTTP response we are creating
       *
       * @exception IOException if an input/output error occurs
       * @exception ServletException if a servlet exception occurs
       */
      public ActionForward perform(ActionMapping mapping,
      ActionForm form,
      HttpServletRequest request,
      HttpServletResponse response)
      throws IOException, ServletException {
          
          Locale locale = (Locale)request.getSession().getAttribute(Action.LOCALE_KEY);
          
          if (resources == null) {
              resources = getServlet().getResources();
          }
          
          try{
              
              // front end validation and checking.
              // ===================================================
              
              // Validate the request parameters specified by the user
              ActionErrors errors = new ActionErrors();
              
              // Report any errors we have discovered back to the original form
              if (!errors.empty()) {
                  saveErrors(request, errors);
                  return (new ActionForward(mapping.getInput()));
              }
              
              if(mBServer == null) {
                  ApplicationServlet servlet = (ApplicationServlet)getServlet();
                  mBServer = servlet.getServer();
              }
              
              /**
               * Get the realm Name from the form.
               * This is used to lookup the MBeanServer and
               * retrieve this realm's MBean.
               */
              String realmName = request.getParameter("realmName");
              
              Iterator realmItr =
              mBServer.queryMBeans(new
              ObjectName(realmName), null).iterator();
              
              ObjectInstance objInstance = (ObjectInstance)realmItr.next();
              ObjectName realmObjName = (objInstance).getObjectName();
              
              /**
               * Extracting the values from the form and
               * updating the MBean with the new values.
               */
        
              String connectionPassword = request.getParameter("connectionPassword");
              if(connectionPassword != null) {
                  mBServer.setAttribute(realmObjName,
                  new Attribute(SetUpJNDIRealmAction.CONN_PWD_PROP_NAME,
                  connectionPassword));
              }
               
              String connectionURL = request.getParameter("connectionURL");
              if(connectionURL != null) {
                  mBServer.setAttribute(realmObjName,
                  new Attribute(SetUpJNDIRealmAction.CONN_URL_PROP_NAME,
                  connectionURL));
              }
               
              String connectionName = request.getParameter("connectionName");
              if(connectionName != null) {
                  mBServer.setAttribute(realmObjName,
                  new Attribute(SetUpJNDIRealmAction.CONN_NAME_PROP_NAME,
                  connectionName));
              }
               
              String contextFactory= request.getParameter("contextFactory");
              if(contextFactory != null) {
                  mBServer.setAttribute(realmObjName,
                  new Attribute(SetUpJNDIRealmAction.CONN_FACT_PROP_NAME,
                  contextFactory));
              }
               
              String debugLvlTxt = request.getParameter("debugLvl");
              if(debugLvlTxt != null) {
                  Integer debugLvl = Integer.valueOf(debugLvlTxt);
                  mBServer.setAttribute(realmObjName,
                  new Attribute(SetUpJNDIRealmAction.DEBUG_PROP_NAME,
                  debugLvl));
              }
               
               
              String searchText = request.getParameter("search");
              if(searchText != null) {
                  Boolean search = Boolean.valueOf(searchText);
                  mBServer.setAttribute(realmObjName,
                  new Attribute(SetUpJNDIRealmAction.ROLE_SUBTREE_PROP_NAME,
                  search));
               
              }
               
              String digest = request.getParameter("digest");
              if(digest != null) {
                  mBServer.setAttribute(realmObjName,
                  new Attribute(SetUpJNDIRealmAction.DIGEST_PROP_NAME,
                  digest));
              }
               
              String roleBase = request.getParameter("roleBase");
              if(roleBase != null) {
                  mBServer.setAttribute(realmObjName,
                  new Attribute(SetUpJNDIRealmAction.ROLE_BASE_PROP_NAME,
                  roleBase));
              }
               
              String roleAttribute = request.getParameter("roleAttribute");
              if(roleAttribute != null) {
                  mBServer.setAttribute(realmObjName,
                  new Attribute(SetUpJNDIRealmAction.ROLE_NAME_PROP_NAME,
                  roleAttribute));
              }
               
              String rolePattern = request.getParameter("rolePattern");
              if(rolePattern != null) {
                  mBServer.setAttribute(realmObjName,
                  new Attribute(SetUpJNDIRealmAction.ROLE_SEARCH_PROP_NAME,
                  rolePattern));
              }
               
              String userPassword = request.getParameter("userPassword");
              if(userPassword != null) {
                  mBServer.setAttribute(realmObjName,
                  new Attribute(SetUpJNDIRealmAction.USER_PWD_PROP_NAME,
                  userPassword));
              }
               
              String userPattern = request.getParameter("userPattern");
              if(userPattern != null) {
                  mBServer.setAttribute(realmObjName,
                  new Attribute(SetUpJNDIRealmAction.USER_PATTERN_PROP_NAME,
                  userPattern));
              }
             
          }catch(Throwable t){
              getServlet().log
              (resources.getMessage(locale, "error.set.attributes"), t);
              response.sendError
              (HttpServletResponse.SC_INTERNAL_SERVER_ERROR,
              resources.getMessage(locale, "error.set.attributes"));
              return (null);
          }
          
          if (servlet.getDebug() >= 1)
              servlet.log(" Forwarding to success page");
          // Forward back to the test page
          return (mapping.findForward("Save Successful"));
          
      }
      
  }
  
  
  
  1.1                  jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/realm/JNDIRealmForm.java
  
  Index: JNDIRealmForm.java
  ===================================================================
  /*
   * $Header: /home/cvs/jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/realm/JNDIRealmForm.java,v 1.1 2002/02/12 06:10:41 manveen Exp $
   * $Revision: 1.1 $
   * $Date: 2002/02/12 06:10:41 $
   *
   * ====================================================================
   *
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2001 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution, if
   *    any, must include the following acknowlegement:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowlegement may appear in the software itself,
   *    if and wherever such third-party acknowlegements normally appear.
   *
   * 4. The names "The Jakarta Project", "Struts", and "Apache Software
   *    Foundation" must not be used to endorse or promote products derived
   *    from this software without prior written permission. For written
   *    permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache"
   *    nor may "Apache" appear in their names without prior written
   *    permission of the Apache Group.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   *
   */
  
  package org.apache.webapp.admin.realm;
  
  import javax.servlet.http.HttpServletRequest;
  import org.apache.struts.action.ActionError;
  import org.apache.struts.action.ActionErrors;
  import org.apache.struts.action.ActionForm;
  import org.apache.struts.action.ActionMapping;
  import java.net.InetAddress;
  import java.util.ArrayList;
  
  import org.apache.webapp.admin.ApplicationServlet;
  import org.apache.webapp.admin.LabelValueBean;
  
  /**
   * Form bean for the JNDI realm page.
   *
   * @author Manveen Kaur
   * @version $Revision: 1.1 $ $Date: 2002/02/12 06:10:41 $
   */
  
  public final class JNDIRealmForm extends ActionForm {
      
      // ----------------------------------------------------- Instance Variables
      
      /**
       * The text for the debug level.
       */
      private String debugLvl = "0";
      
      /**
       * The text for the realm name, used to retrieve
       * the corresponding realm mBean.
       */
      private String realmName = null;
      
      /**
       * The text for the realm type.
       * Specifies if it is a JNDI, JNDI or MemoryRealm.
       */
      private String realmType = null;
      
      /**
       * The text for the node label.
       */
      private String nodeLabel = null;
      
      /**
       * The text for the search subtree.
       */
      private String search = "false";
      
      /**
       * The text for the digest algorithm.
       */
      private String digest = null;
      
      /**
       * The text for the role Base.
       */
      private String roleBase = null;
      
      /**
       * The text for the role Attribute.
       */
      private String roleAttribute = null;
      
      /**
       * The text for the role Pattern.
       */
      private String rolePattern = null;
      
      /**
       * The text for the connection user name.
       */
      private String connectionName = null;
      
      /**
       * The text for the connection Password.
       */
      private String connectionPassword = null;
      
      /**
       * The text for the connection URL.
       */
      private String connectionURL = null;
      
      /**
       * The text for the context Factory.
       */
      private String contextFactory = null;
      
      /**
       * The text for the user Password.
       */
      private String userPassword = null;
      
      /**
       * The text for the user search Pattern.
       */
      private String userPattern = null;
      
      /**
       * Set of valid values for debug level.
       */
      private ArrayList debugLvlVals = null;
      
      /**
       * Set of valid values for search subtrees(true/false).
       */
      private ArrayList searchVals = null;
      
      // ------------------------------------------------------------- Properties
      
      /**
       * Return the Realm Name.
       */
      public String getRealmName() {
          
          return this.realmName;
          
      }
      
      /**
       * Set the Realm Name.
       */
      public void setRealmName(String realmName) {
          
          this.realmName = realmName;
          
      }
      
      /**
       * Return the Realm type.
       */
      public String getRealmType() {
          
          return this.realmType;
          
      }
      
      /**
       * Set the Realm type.
       */
      public void setRealmType(String realmType) {
          
          this.realmType = realmType;
          
      }
      
      /**
       * Return the debugVals.
       */
      public ArrayList getDebugLvlVals() {
          
          return this.debugLvlVals;
          
      }
      
      /**
       * Set the debugVals.
       */
      public void setDebugLvlVals(ArrayList debugLvlVals) {
          
          this.debugLvlVals = debugLvlVals;
          
      }
      
      /**
       * Return the search Vals.
       */
      public ArrayList getSearchVals() {
          
          return this.searchVals;
          
      }
      
      /**
       * Set the search Vals.
       */
      public void setSearchVals(ArrayList searchVals) {
          
          this.searchVals = searchVals;
          
      }
      
      /**
       * Return the Debug Level Text.
       */
      public String getDebugLvl() {
          
          return this.debugLvl;
          
      }
      
      /**
       * Set the Debug Level Text.
       */
      public void setDebugLvl(String debugLvl) {
          
          this.debugLvl = debugLvl;
          
      }
      
      /**
       * Return the search boolean Text.
       */
      public String getSearch() {
          
          return this.search;
          
      }
      
      /**
       * Set the search Text.
       */
      public void setSearch(String search) {
          
          this.search = search;
          
      }
      
      /**
       * Return the digest.
       */
      public String getDigest() {
          
          return this.digest;
          
      }
      
      /**
       * Set the digest.
       */
      public void setDigest(String digest) {
          
          this.digest = digest;
          
      }
      
      /**
       * Return the roleBase .
       */
      public String getRoleBase() {
          
          return this.roleBase ;
          
      }
      
      /**
       * Set the roleBase .
       */
      public void setRoleBase(String roleBase ) {
          
          this.roleBase  = roleBase ;
          
      }
    
      /**
       * Return the role Attribute .
       */
      public String getRoleAttribute() {
          
          return this.roleAttribute ;
          
      }
      
      /**
       * Set the role Attribute .
       */
      public void setRoleAttribute(String roleAttribute ) {
          
          this.roleAttribute  = roleAttribute ;
          
      }
      
      /**
       * Return the role Pattern
       */
      public String getRolePattern() {
          
          return this.rolePattern ;
          
      }
      
      /**
       * Set the role Pattern.
       */
      public void setRolePattern(String rolePattern ) {
          
          this.rolePattern  = rolePattern ;
          
      }
      
      /**
       * Return the label of the node that was clicked.
       */
      public String getNodeLabel() {
          
          return this.nodeLabel;
          
      }
      
      /**
       * Set the node label.
       */
      public void setNodeLabel(String nodeLabel) {
          
          this.nodeLabel = nodeLabel;
          
      }
      
      /**
       * Return the user Password .
       */
      public String getUserPassword() {
          
          return this.userPassword ;
          
      }
      
      /**
       * Set the user Password .
       */
      public void setUserPassword(String userPassword ) {
          
          this.userPassword  = userPassword ;
          
      }
      
      
      /**
       * Return the user Pattern .
       */
      public String getUserPattern() {
          
          return this.userPattern  ;
          
      }
      
      /**
       * Set the user user Pattern  .
       */
      public void setUserPattern(String userPattern) {
          
          this.userPattern   = userPattern  ;
          
      }
      
      /**
       * Return the connection name.
       */
      public String getConnectionName() {
          
          return this.connectionName;
          
      }
      
      /**
       * Set the connectionName.
       */
      public void setConnectionName(String connectionName) {
          
          this.connectionName = connectionName;
          
      }
      
      
      /**
       * Return the connection password.
       */
      public String getConnectionPassword() {
          
          return this.connectionPassword;
          
      }
      
      /**
       * Set the connection password.
       */
      public void setConnectionPassword(String connectionPassword) {
          
          this.connectionPassword = connectionPassword;
          
      }
      
      
      /**
       * Return the connection URL.
       */
      public String getConnectionURL() {
          
          return this.connectionURL;
          
      }
      
      /**
       * Set the connectionURL.
       */
      public void setConnectionURL(String connectionURL) {
          
          this.connectionURL = connectionURL;
          
      }
      
      /**
       * Return the context Factory .
       */
      public String getContextFactory() {
          
          return this.contextFactory ;
          
      }
      
      /**
       * Set the context Factory .
       */
      public void setContextFactory(String contextFactory ) {
          
          this.contextFactory  = contextFactory ;
          
      }
      
      // --------------------------------------------------------- Public Methods
      
      /**
       * Reset all properties to their default values.
       *
       * @param mapping The mapping used to select this instance
       * @param request The servlet request we are processing
       */
      public void reset(ActionMapping mapping, HttpServletRequest request) {
          
          this.debugLvl = "0";
          this.search="false";
          
          this.digest = null;
          this.roleAttribute = null;
          
          this.connectionName = null;
          this.connectionPassword = null;
          this.connectionURL = null;
          
          this.rolePattern = null;
          this.roleBase = null;
          this.userPassword = null;
          this.userPattern = null;
          this.contextFactory = null;
      }
      
      /**
       * Validate the properties that have been set from this HTTP request,
       * and return an <code>ActionErrors</code> object that encapsulates any
       * validation errors that have been found.  If no errors are found, return
       * <code>null</code> or an <code>ActionErrors</code> object with no
       * recorded error messages.
       *
       * @param mapping The mapping used to select this instance
       * @param request The servlet request we are processing
       */
      
      public ActionErrors validate(ActionMapping mapping,
      HttpServletRequest request) {
          
          ActionErrors errors = new ActionErrors();
          
          String submit = request.getParameter("submit");
          String type = request.getParameter("realmType");
          
          // front end validation when save is clicked.
          if (submit != null) {
              // the following fields are required.
               
              if ((digest == null) || (digest.length() < 1)) {
                  errors.add("digest",
                  new ActionError("error.digest.required"));
              }
               
              if ((roleAttribute == null) || (roleAttribute.length() < 1)) {
                  errors.add("roleAttribute",
                  new ActionError("error.roleAttribute.required"));
              }
              
              if ((rolePattern == null) || (rolePattern.length() < 1)) {
                  errors.add("rolePattern",
                  new ActionError("error.rolePattern.required"));
              }
              
              if ((roleBase == null) || (roleBase.length() < 1)) {
                  errors.add("roleBase",
                  new ActionError("error.roleBase.required"));
              }
              
              if ((userPassword == null) || (userPassword.length() < 1)) {
                  errors.add("userPassword",
                  new ActionError("error.userPassword.required"));
              }
              
              if ((userPattern == null) || (userPattern.length() < 1)) {
                  errors.add("userPattern",
                  new ActionError("error.userPattern.required"));
              }
              
              if ((connectionName == null) || (connectionName.length() < 1)) {
                  errors.add("connectionName",
                  new ActionError("error.connName.required"));
              }
              
              if ((connectionPassword == null) || (connectionPassword.length() < 1)) {
                  errors.add("connectionPassword",
                  new ActionError("error.connPassword.required"));
              }
              
              if ((connectionURL == null) || (connectionURL.length() < 1)) {
                  errors.add("connectionURL",
                  new ActionError("error.connURL.required"));
              }
              
               if ((contextFactory == null) || (contextFactory.length() < 1)) {
                  errors.add("contextFactory",
                  new ActionError("error.contextFactory.required"));
              }
          }
          
          return errors;
      }
  }
  
  
  
  1.1                  jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/realm/SetUpJNDIRealmAction.java
  
  Index: SetUpJNDIRealmAction.java
  ===================================================================
  /*
   * $Header: /home/cvs/jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/realm/SetUpJNDIRealmAction.java,v 1.1 2002/02/12 06:10:41 manveen Exp $
   * $Revision: 1.1 $
   * $Date: 2002/02/12 06:10:41 $
   *
   * ====================================================================
   *
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2001 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution, if
   *    any, must include the following acknowlegement:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowlegement may appear in the software itself,
   *    if and wherever such third-party acknowlegements normally appear.
   *
   * 4. The names "The Jakarta Project", "Tomcat", and "Apache Software
   *    Foundation" must not be used to endorse or promote products derived
   *    from this software without prior written permission. For written
   *    permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache"
   *    nor may "Apache" appear in their names without prior written
   *    permission of the Apache Group.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   *
   */
  
  package org.apache.webapp.admin.realm;
  
  import java.io.IOException;
  import java.util.Iterator;
  import java.util.List;
  import java.util.Locale;
  import java.util.ArrayList;
  import javax.servlet.ServletException;
  import javax.servlet.http.HttpServletRequest;
  import javax.servlet.http.HttpServletResponse;
  import javax.servlet.http.HttpSession;
  import org.apache.struts.action.Action;
  import org.apache.struts.action.ActionErrors;
  import org.apache.struts.action.ActionForm;
  import org.apache.struts.action.ActionForward;
  import org.apache.struts.action.ActionMapping;
  
  import javax.management.MBeanServer;
  import javax.management.MBeanServerFactory;
  import javax.management.QueryExp;
  import javax.management.Query;
  import javax.management.ObjectInstance;
  import javax.management.ObjectName;
  
  import org.apache.webapp.admin.ApplicationServlet;
  import org.apache.webapp.admin.LabelValueBean;
  
  import org.apache.struts.util.MessageResources;
  
  /**
   * Test <code>Action</code> that handles events from the tree control when
   * a JNDI realm is chosen.
   *
   * @author Manveen Kaur
   * @version $Revision: 1.1 $ $Date: 2002/02/12 06:10:41 $
   */
  
  public class SetUpJNDIRealmAction extends Action {
      
      private static MBeanServer mBServer = null;
      
      public final static String CONN_NAME_PROP_NAME = "connectionName";
      public final static String CONN_PWD_PROP_NAME = "connectionPassword";
      public final static String CONN_URL_PROP_NAME = "connectionURL";
      
      public final static String DEBUG_PROP_NAME = "debug";
      public final static String DIGEST_PROP_NAME = "digest";
      public final static String CONN_FACT_PROP_NAME = "contextFactory";
      public final static String ROLE_BASE_PROP_NAME = "roleBase";
      public final static String ROLE_NAME_PROP_NAME = "roleName";
      public final static String ROLE_SEARCH_PROP_NAME = "roleSearch";
      public final static String ROLE_SUBTREE_PROP_NAME = "roleSubtree";
      public final static String USER_PWD_PROP_NAME = "userPassword";
      public final static String USER_PATTERN_PROP_NAME = "userPattern";
      
      private String selectedName = null;
      private String realmType = null;
      private String nodeLabel = null;
      private ArrayList debugLvlList = null;
      private ArrayList searchList = null;
      
      /**
       * The MessageResources we will be retrieving messages from.
       */
      private MessageResources resources = null;
      
      
      // --------------------------------------------------------- Public Methods
      
      /**
       * Process the specified HTTP request, and create the corresponding HTTP
       * response (or forward to another web component that will create it).
       * Return an <code>ActionForward</code> instance describing where and how
       * control should be forwarded, or <code>null</code> if the response has
       * already been completed.
       *
       * @param mapping The ActionMapping used to select this instance
       * @param actionForm The optional ActionForm bean for this request (if any)
       * @param request The HTTP request we are processing
       * @param response The HTTP response we are creating
       *
       * @exception IOException if an input/output error occurs
       * @exception ServletException if a servlet exception occurs
       */
      public ActionForward perform(ActionMapping mapping,
      ActionForm form,
      HttpServletRequest request,
      HttpServletResponse response)
      throws IOException, ServletException {
          
          HttpSession session = request.getSession();
          realmType = request.getParameter("type");
          Locale locale = (Locale) session.getAttribute(Action.LOCALE_KEY);
          
          if (resources == null) {
              resources = getServlet().getResources();
          }
          
          if (form == null) {
              getServlet().log(" Creating new JNDIRealmForm bean under key "
              + mapping.getAttribute());
              
              form = new JNDIRealmForm();
              
              if ("request".equals(mapping.getScope()))
                  request.setAttribute(mapping.getAttribute(), form);
              else
                  session.setAttribute(mapping.getAttribute(), form);
          }
          
          selectedName = request.getParameter("select");
          realmType = request.getParameter("type");
          nodeLabel = request.getParameter("nodeLabel");
          
          JNDIRealmForm realmFm = (JNDIRealmForm) form;
          
          if(debugLvlList == null) {
              debugLvlList = new ArrayList();
              debugLvlList.add(new LabelValueBean("0", "0"));
              debugLvlList.add(new LabelValueBean("1", "1"));
              debugLvlList.add(new LabelValueBean("2", "2"));
              debugLvlList.add(new LabelValueBean("3", "3"));
              debugLvlList.add(new LabelValueBean("4", "4"));
              debugLvlList.add(new LabelValueBean("5", "5"));
              debugLvlList.add(new LabelValueBean("6", "6"));
              debugLvlList.add(new LabelValueBean("7", "7"));
              debugLvlList.add(new LabelValueBean("8", "8"));
              debugLvlList.add(new LabelValueBean("9", "9"));
          }
          
          if(searchList == null) {
              searchList = new ArrayList();
                          searchList.add(new LabelValueBean("True", "true"));
              searchList.add(new LabelValueBean("False", "false"));
          }
                  
          try{
              
              if(mBServer == null) {
                  ApplicationServlet servlet = (ApplicationServlet)getServlet();
                  mBServer = servlet.getServer();
              }
              
              Iterator realmItr =
              mBServer.queryMBeans(new
              ObjectName(selectedName), null).iterator();
              
              ObjectInstance objInstance = (ObjectInstance)realmItr.next();
              ObjectName realmObjName = (objInstance).getObjectName();
              
              realmFm.setDebugLvl(
              ((Integer) mBServer.getAttribute(realmObjName, DEBUG_PROP_NAME)).toString());
              
              realmFm.setContextFactory(
              ((String) mBServer.getAttribute(realmObjName, CONN_FACT_PROP_NAME)));
              
              realmFm.setConnectionPassword(
              ((String) mBServer.getAttribute(realmObjName, CONN_PWD_PROP_NAME)));
              
              realmFm.setConnectionName(
              ((String) mBServer.getAttribute(realmObjName, CONN_NAME_PROP_NAME)));
              
              realmFm.setConnectionURL(
              ((String) mBServer.getAttribute(realmObjName, CONN_URL_PROP_NAME)));
              
              realmFm.setDigest(
              ((String) mBServer.getAttribute(realmObjName, DIGEST_PROP_NAME)));
              
              realmFm.setRoleBase(
              ((String) mBServer.getAttribute(realmObjName, ROLE_BASE_PROP_NAME)));
              
              realmFm.setRoleAttribute(
              ((String) mBServer.getAttribute(realmObjName, ROLE_NAME_PROP_NAME)));
              
              realmFm.setRolePattern(
              ((String) mBServer.getAttribute(realmObjName, ROLE_SEARCH_PROP_NAME)));
              
              realmFm.setSearch(
              ((String) mBServer.getAttribute(realmObjName, ROLE_SUBTREE_PROP_NAME)));
              
              realmFm.setUserPassword(
              ((String) mBServer.getAttribute(realmObjName, USER_PWD_PROP_NAME)));
              
              realmFm.setUserPattern(
              ((String) mBServer.getAttribute(realmObjName, USER_PATTERN_PROP_NAME)));
              
          } catch(Throwable t){
              getServlet().log
              (resources.getMessage(locale, "error.get.attributes"), t);
              response.sendError
              (HttpServletResponse.SC_INTERNAL_SERVER_ERROR,
              resources.getMessage(locale, "error.get.attributes"));
              return (null);
          }
          
          realmFm.setRealmName(selectedName);
          realmFm.setNodeLabel(nodeLabel);
          
          realmFm.setRealmType(realmType);
          realmFm.setDebugLvlVals(debugLvlList);
          realmFm.setSearchVals(searchList);
          
          // Forward back to the appropriate Realm page
          return (mapping.findForward("JNDIRealm"));
          
      }
  }
  
  
  
  
  1.1                  jakarta-tomcat-4.0/webapps/admin/realm/jdbcRealm.jsp
  
  Index: jdbcRealm.jsp
  ===================================================================
  <!-- Standard Struts Entries -->
  <%@ page language="java" %>
  <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
  <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
  <%@ taglib uri="/WEB-INF/controls.tld" prefix="controls" %>
  
  <html:html locale="true">
  
  <%@ include file="../users/header.jsp" %>
  
  <!-- Body -->
  <body bgcolor="white">
  
  <!--Form -->
  
  <html:errors/>
  
  <html:form method="POST" action="/JDBCRealm">
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr bgcolor="7171A5">
        <td width="81%">
          <html:hidden property="realmName"/>
          <html:hidden property="realmType"/>
         <div class="page-title-text" align="left"> 
            <bean:write name="jdbcRealmForm" property="nodeLabel" scope="session"/>
         </div>
        </td>
        <td width="19%"> 
          <div align="right">
        <controls:actions>
              <controls:action selected="true"> ----<bean:message key="actions.available.actions"/>---- </controls:action>
              <controls:action> --------------------------------- </controls:action>
              <controls:action url="">  <bean:message key="actions.thisrealm.delete"/> </controls:action>
         </controls:actions>   
           </div>
        </td>
      </tr>
    </table>
      <%@ include file="../buttons.jsp" %>
    <br>
  
    <table class="back-table" border="0" cellspacing="0" cellpadding="0" width="100%">
      <tr> 
        <td> 
         <controls:table tableStyle="front-table" lineStyle="line-row">
              <controls:row header="true" 
                  labelStyle="table-header-text" dataStyle="table-header-text">
              <controls:label><bean:message key="service.property"/></controls:label>
              <controls:data><bean:message key="service.value"/></controls:data>
          </controls:row>
  
        <controls:row labelStyle="table-label-text" dataStyle="table-normal-text">
              <controls:label><bean:message key="connector.type"/>:</controls:label>
              <controls:data>
                <bean:write name="jdbcRealmForm" property="realmType" scope="session"/>
              </controls:data>
          </controls:row>
        
          <controls:row labelStyle="table-label-text" dataStyle="table-normal-text">
              <controls:label><bean:message key="realm.driver"/>:</controls:label>
              <controls:data>
                <html:text property="driver" size="30"/>
              </controls:data>
          </controls:row>
        
          <controls:row labelStyle="table-label-text" dataStyle="table-normal-text">
              <controls:label><bean:message key="realm.passwd"/>:</controls:label>
              <controls:data>
                  <html:text property="connectionPassword" size="30"/>
              </controls:data>
          </controls:row>
        
          <controls:row labelStyle="table-label-text" dataStyle="table-normal-text">
              <controls:label><bean:message key="realm.url"/>:</controls:label>
              <controls:data>
                  <html:text property="connectionURL" size="30"/>
              </controls:data>
          </controls:row>
  
          <controls:row labelStyle="table-label-text" dataStyle="table-normal-text">
              <controls:label><bean:message key="realm.userName"/>:</controls:label>
              <controls:data>
                  <html:text property="connectionName" size="30"/>
              </controls:data>
          </controls:row>
  
          <controls:row labelStyle="table-label-text" dataStyle="table-normal-text">
              <controls:label><bean:message key="server.debuglevel"/>:</controls:label>
              <controls:data>
                 <html:select property="debugLvl">
                       <bean:define id="debugLvlVals" name="jdbcRealmForm" property="debugLvlVals"/>
                       <html:options collection="debugLvlVals" property="value"
                          labelProperty="label"/>
                  </html:select>
              </controls:data>
          </controls:row>
  
  
          <controls:row labelStyle="table-label-text" dataStyle="table-normal-text">
              <controls:label><bean:message key="realm.digest"/>:</controls:label>
              <controls:data>
                  <html:text property="digest" size="30"/>
              </controls:data>
          </controls:row>
  
          <controls:row labelStyle="table-label-text" dataStyle="table-normal-text">
              <controls:label><bean:message key="realm.passwordCol"/>:</controls:label>
              <controls:data>
                  <html:text property="passwordCol" size="30"/>
              </controls:data>
          </controls:row>
  
          <controls:row labelStyle="table-label-text" dataStyle="table-normal-text">
              <controls:label><bean:message key="realm.roleNameCol"/>:</controls:label>
              <controls:data>
                  <html:text property="roleNameCol" size="30"/>
              </controls:data>
          </controls:row>
  
          <controls:row labelStyle="table-label-text" dataStyle="table-normal-text">
              <controls:label><bean:message key="realm.userRoleTable"/>:</controls:label>
              <controls:data>
                  <html:text property="roleTable" size="30"/>
              </controls:data>
          </controls:row>
  
          <controls:row labelStyle="table-label-text" dataStyle="table-normal-text">
              <controls:label><bean:message key="realm.userTable"/>:</controls:label>
              <controls:data>
                  <html:text property="userTable" size="30"/>
              </controls:data>
          </controls:row>
        
        </controls:table>
        </td>
      </tr>
    </table>    
      <%@ include file="../buttons.jsp" %>
    <br>
    </html:form>
  <p>&nbsp;</p>
  </body>
  </html:html>
  
  
  
  1.1                  jakarta-tomcat-4.0/webapps/admin/realm/jndiRealm.jsp
  
  Index: jndiRealm.jsp
  ===================================================================
  <!-- Standard Struts Entries -->
  <%@ page language="java" %>
  <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
  <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
  <%@ taglib uri="/WEB-INF/controls.tld" prefix="controls" %>
  
  <html:html locale="true">
  
  <%@ include file="../users/header.jsp" %>
  
  <!-- Body -->
  <body bgcolor="white">
  
  <!--Form -->
  
  <html:errors/>
  
  <html:form method="POST" action="/JNDIRealm">
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr bgcolor="7171A5">
        <td width="81%">
          <html:hidden property="realmName"/>
          <html:hidden property="realmType"/>
         <div class="page-title-text" align="left"> 
            <bean:write name="jndiRealmForm" property="nodeLabel" scope="session"/>
         </div>
        </td>
        <td width="19%"> 
          <div align="right">
        <controls:actions>
              <controls:action selected="true"> ----<bean:message key="actions.available.actions"/>---- </controls:action>
              <controls:action> --------------------------------- </controls:action>
             <%--
              <controls:action url="">  <bean:message key="actions.thisrealm.delete"/> </controls:action>
              --%>
         </controls:actions>   
           </div>
        </td>
      </tr>
    </table>
      <%@ include file="../buttons.jsp" %>
    <br>
  
    <table class="back-table" border="0" cellspacing="0" cellpadding="0" width="100%">
      <tr> 
        <td> 
         <controls:table tableStyle="front-table" lineStyle="line-row">
              <controls:row header="true" 
                  labelStyle="table-header-text" dataStyle="table-header-text">
              <controls:label><bean:message key="service.property"/></controls:label>
              <controls:data><bean:message key="service.value"/></controls:data>
          </controls:row>
  
        <controls:row labelStyle="table-label-text" dataStyle="table-normal-text">
              <controls:label><bean:message key="connector.type"/>:</controls:label>
              <controls:data>
                <bean:write name="jndiRealmForm" property="realmType" scope="session"/>
              </controls:data>
          </controls:row>
        
          <controls:row labelStyle="table-label-text" dataStyle="table-normal-text">
              <controls:label><bean:message key="realm.connName"/>:</controls:label>
              <controls:data>
                <html:text property="connectionName" size="30"/>
              </controls:data>
          </controls:row>
        
          <controls:row labelStyle="table-label-text" dataStyle="table-normal-text">
              <controls:label><bean:message key="realm.connPassword"/>:</controls:label>
              <controls:data>
                  <html:text property="connectionPassword" size="30"/>
              </controls:data>
          </controls:row>
        
          <controls:row labelStyle="table-label-text" dataStyle="table-normal-text">
              <controls:label><bean:message key="realm.connURL"/>:</controls:label>
              <controls:data>
                  <html:text property="connectionURL" size="30"/>
              </controls:data>
          </controls:row>
  
          <controls:row labelStyle="table-label-text" dataStyle="table-normal-text">
              <controls:label><bean:message key="realm.connFactory"/>:</controls:label>
              <controls:data>
                  <html:text property="contextFactory" size="30"/>
              </controls:data>
          </controls:row>
  
          <controls:row labelStyle="table-label-text" dataStyle="table-normal-text">
              <controls:label><bean:message key="server.debuglevel"/>:</controls:label>
              <controls:data>
                 <html:select property="debugLvl">
                       <bean:define id="debugLvlVals" name="jndiRealmForm" property="debugLvlVals"/>
                       <html:options collection="debugLvlVals" property="value"
                          labelProperty="label"/>
                  </html:select>
              </controls:data>
          </controls:row>
  
         <controls:row labelStyle="table-label-text" dataStyle="table-normal-text">
              <controls:label><bean:message key="realm.digest"/>:</controls:label>
              <controls:data>
                  <html:text property="digest" size="30"/>
              </controls:data>
          </controls:row>
  
          <controls:row labelStyle="table-label-text" dataStyle="table-normal-text">
              <controls:label><bean:message key="realm.roleBase"/>:</controls:label>
              <controls:data>
                  <html:text property="roleBase" size="30"/>
              </controls:data>
          </controls:row>
  
          <controls:row labelStyle="table-label-text" dataStyle="table-normal-text">
              <controls:label><bean:message key="realm.Attribute"/>:</controls:label>
              <controls:data>
                  <html:text property="roleAttribute" size="30"/>
              </controls:data>
          </controls:row>
  
          <controls:row labelStyle="table-label-text" dataStyle="table-normal-text">
              <controls:label><bean:message key="realm.pattern"/>:</controls:label>
              <controls:data>
                  <html:text property="rolePattern" size="30"/>
              </controls:data>
          </controls:row>
  
          <controls:row labelStyle="table-label-text" dataStyle="table-normal-text">
              <controls:label><bean:message key="realm.search"/>:</controls:label>
              <controls:data>
               <html:select property="search">
                       <bean:define id="searchVals" name="jndiRealmForm" property="searchVals"/>
                       <html:options collection="searchVals" property="value"
                          labelProperty="label"/>
                  </html:select>
                </controls:data>
          </controls:row>
  
          <controls:row labelStyle="table-label-text" dataStyle="table-normal-text">
              <controls:label><bean:message key="realm.userPassword"/>:</controls:label>
              <controls:data>
                  <html:text property="userPassword" size="30"/>
              </controls:data>
          </controls:row>
        
          <controls:row labelStyle="table-label-text" dataStyle="table-normal-text">
              <controls:label><bean:message key="realm.userPattern"/>:</controls:label>
              <controls:data>
                  <html:text property="userPattern" size="30"/>
              </controls:data>
          </controls:row>
        
        </controls:table>
        </td>
      </tr>
    </table>
    
      <%@ include file="../buttons.jsp" %>
    <br>
    </html:form>
  <p>&nbsp;</p>
  </body>
  </html:html>
  
  
  
  1.1                  jakarta-tomcat-4.0/webapps/admin/realm/memoryRealm.jsp
  
  Index: memoryRealm.jsp
  ===================================================================
  <!-- Standard Struts Entries -->
  <%@ page language="java" %>
  <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
  <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
  <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
  <%@ taglib uri="/WEB-INF/controls.tld" prefix="controls" %>
  
  <html:html locale="true">
  
  <%@ include file="../users/header.jsp" %>
  
  <!-- Body -->
  <body bgcolor="white">
  
  <!--Form -->
  
  <html:errors/>
  
  <html:form method="GET" action="/MemoryRealm">
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr bgcolor="7171A5">
        <td width="81%"> 
          <html:hidden property="realmName"/>
          <html:hidden property="realmType"/>
          <div class="page-title-text" align="left">
            <bean:write name="memoryRealmForm" property="nodeLabel" scope="session"/>
          </div>
        </td>
        <td width="19%"> 
          <div align="right">
        <controls:actions>
              <controls:action selected="true"> ----<bean:message key="actions.available.actions"/>---- </controls:action>
              <controls:action> --------------------------------- </controls:action>
              <%--
              <controls:action url="">  <bean:message key="actions.thisrealm.delete"/> </controls:action>
              --%>
         </controls:actions>   
           </div>
        </td>
      </tr>
    </table>
      <%@ include file="../buttons.jsp" %>
    <br>
  
    <table class="back-table" border="0" cellspacing="0" cellpadding="0" width="100%">
      <tr> 
        <td> 
         <controls:table tableStyle="front-table" lineStyle="line-row">
              <controls:row header="true" 
                  labelStyle="table-header-text" dataStyle="table-header-text">
              <controls:label><bean:message key="service.property"/></controls:label>
              <controls:data><bean:message key="service.value"/></controls:data>
          </controls:row>
  
        <controls:row labelStyle="table-label-text" dataStyle="table-normal-text">
              <controls:label><bean:message key="connector.type"/>:</controls:label>
              <controls:data>
                <bean:write name="memoryRealmForm" property="realmType" scope="session"/>
              </controls:data>
          </controls:row>
  
          <controls:row labelStyle="table-label-text" dataStyle="table-normal-text">
              <controls:label><bean:message key="server.debuglevel"/>:</controls:label>
              <controls:data>
                 <html:select property="debugLvl">
                       <bean:define id="debugLvlVals" name="memoryRealmForm" property="debugLvlVals"/>
                       <html:options collection="debugLvlVals" property="value"
                          labelProperty="label"/>
                  </html:select>
              </controls:data>
          </controls:row>
  
          <controls:row labelStyle="table-label-text" dataStyle="table-normal-text">
              <controls:label><bean:message key="realm.pathName"/>:</controls:label>
              <controls:data>               
                  <html:text property="pathName" size="25"/>
              </controls:data>
          </controls:row>
      
        </controls:table>
        </td>
      </tr>
    </table>
      
      <%@ include file="../buttons.jsp" %>
    <br>
    </html:form>
  <p>&nbsp;</p>
  </body>
  </html:html>
  
  
  
  1.1                  jakarta-tomcat-4.0/webapps/admin/realm/userDBRealm.jsp
  
  Index: userDBRealm.jsp
  ===================================================================
  <!-- Standard Struts Entries -->
  <%@ page language="java" %>
  <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
  <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
  <%@ taglib uri="/WEB-INF/controls.tld" prefix="controls" %>
  
  <html:html locale="true">
  
  <%@ include file="../users/header.jsp" %>
  
  <!-- Body -->
  <body bgcolor="white">
  
  <!--Form -->
  
  <html:errors/>
  
  <html:form method="POST" action="/UserDBRealm">
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr bgcolor="7171A5">
        <td width="81%"> 
          <html:hidden property="realmName"/>
          <html:hidden property="realmType"/>
          <div class="page-title-text" align="left"> 
            <bean:write name="userdbRealmForm" property="nodeLabel" scope="session"/>
          </div>
        </td>
        <td width="19%"> 
          <div align="right">
        <controls:actions>
              <controls:action selected="true"> ----<bean:message key="actions.available.actions"/>---- </controls:action>
              <controls:action> --------------------------------- </controls:action>
              <%--
              <controls:action url="">  <bean:message key="actions.thisrealm.delete"/> </controls:action>
              --%>
         </controls:actions>   
           </div>
        </td>
      </tr>
    </table>
      <%@ include file="../buttons.jsp" %>
    <br>
  
    <table class="back-table" border="0" cellspacing="0" cellpadding="0" width="100%">
      <tr> 
        <td> 
         <controls:table tableStyle="front-table" lineStyle="line-row">
              <controls:row header="true" 
                  labelStyle="table-header-text" dataStyle="table-header-text">
              <controls:label><bean:message key="service.property"/></controls:label>
              <controls:data><bean:message key="service.value"/></controls:data>
          </controls:row>
  
        <controls:row labelStyle="table-label-text" dataStyle="table-normal-text">
              <controls:label><bean:message key="connector.type"/>:</controls:label>
              <controls:data>
                <bean:write name="userdbRealmForm" property="realmType" scope="session"/>
              </controls:data>
          </controls:row>
  
          <controls:row labelStyle="table-label-text" dataStyle="table-normal-text">
              <controls:label><bean:message key="server.debuglevel"/>:</controls:label>
              <controls:data>
                 <html:select property="debugLvl">
                       <bean:define id="debugLvlVals" name="userdbRealmForm" property="debugLvlVals"/>
                       <html:options collection="debugLvlVals" property="value"
                          labelProperty="label"/>
                  </html:select>
              </controls:data>
          </controls:row>
  
          <controls:row labelStyle="table-label-text" dataStyle="table-normal-text">
              <controls:label><bean:message key="realm.resource"/>:</controls:label>
              <controls:data>
                  <html:text property="resource" size="25" maxlength="25"/>
              </controls:data>
          </controls:row>
      
        </controls:table>
        </td>
      </tr>
    </table>
      
      <%@ include file="../buttons.jsp" %>
    <br>
    </html:form>
  <p>&nbsp;</p>
  </body>
  </html:html>
  
  
  

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>