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

cvs commit: jakarta-tomcat-4.0/webapps/admin/users deleteGroups.jsp deleteRoles.jsp deleteUsers.jsp groups.jspf listGroups.jspf listRoles.jspf listUsers.jspf users.jspf listGroups.jsp listRoles.jsp listUsers.jsp roles.jspf

craigmcc    02/02/09 21:48:58

  Modified:    webapps/admin/WEB-INF struts-config.xml
               webapps/admin/WEB-INF/classes/org/apache/webapp/admin
                        ApplicationResources_en.properties
               webapps/admin/WEB-INF/classes/org/apache/webapp/admin/users
                        ListGroupsAction.java ListRolesAction.java
                        ListUsersAction.java SaveGroupAction.java
                        SaveRoleAction.java SaveUserAction.java
                        UsersTreeBuilder.java
               webapps/admin/users listGroups.jsp listRoles.jsp
                        listUsers.jsp roles.jspf
  Added:       webapps/admin/WEB-INF/classes/org/apache/webapp/admin/users
                        DeleteGroupsAction.java DeleteRolesAction.java
                        DeleteUsersAction.java GroupsForm.java
                        RolesForm.java UsersForm.java
               webapps/admin/users deleteGroups.jsp deleteRoles.jsp
                        deleteUsers.jsp groups.jspf listGroups.jspf
                        listRoles.jspf listUsers.jspf users.jspf
  Log:
  Implement delete functionality for groups, roles, and users.
  
  Revision  Changes    Path
  1.26      +44 -6     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.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- struts-config.xml	10 Feb 2002 03:14:11 -0000	1.25
  +++ struts-config.xml	10 Feb 2002 05:48:57 -0000	1.26
  @@ -63,6 +63,7 @@
       <form-bean      name="userdbRealmForm"
                       type="org.apache.webapp.admin.realm.UserDBRealmForm"/>
   
  +
       <!-- ========== User Database Module ========== -->
   
       <form-bean      name="databaseForm"
  @@ -71,12 +72,20 @@
       <form-bean      name="groupForm"
                       type="org.apache.webapp.admin.users.GroupForm"/>
   
  +    <form-bean      name="groupsForm"
  +                    type="org.apache.webapp.admin.users.GroupsForm"/>
  +
       <form-bean      name="roleForm"
                       type="org.apache.webapp.admin.users.RoleForm"/>
   
  +    <form-bean      name="rolesForm"
  +                    type="org.apache.webapp.admin.users.RolesForm"/>
  +
       <form-bean      name="userForm"
                       type="org.apache.webapp.admin.users.UserForm"/>
   
  +    <form-bean      name="usersForm"
  +                    type="org.apache.webapp.admin.users.UsersForm"/>
   
       <!-- ========== ==================== ========== -->
   
  @@ -160,46 +169,60 @@
                       path="/userDBRealm.jsp"
                   redirect="false"/>
   
  +
       <!-- ========== User Database Module ========== -->
   
       <forward        name="Group"
                       path="/users/group.jsp"
                   redirect="false"/>
   
  +    <forward        name="Groups Delete List"
  +                    path="/users/deleteGroups.jsp"
  +                redirect="false"/>
  +
       <forward        name="Groups List"
                       path="/users/listGroups.jsp"
                   redirect="false"/>
   
       <forward        name="Groups List Setup"
  -                    path="/users/listGroups.do"
  +                    path="/users/listGroups.do?forward=Groups+List"
                   redirect="false"/>
   
       <forward        name="Role"
                       path="/users/role.jsp"
                   redirect="false"/>
   
  +    <forward        name="Roles Delete List"
  +                    path="/users/deleteRoles.jsp"
  +                redirect="false"/>
  +
       <forward        name="Roles List"
                       path="/users/listRoles.jsp"
                   redirect="false"/>
   
       <forward        name="Roles List Setup"
  -                    path="/users/listRoles.do"
  +                    path="/users/listRoles.do?forward=Roles+List"
                   redirect="false"/>
   
       <forward        name="User"
                       path="/users/user.jsp"
                   redirect="false"/>
   
  +    <forward        name="Users Delete List"
  +                    path="/users/deleteUsers.jsp"
  +                redirect="false"/>
  +
       <forward        name="Users List"
                       path="/users/listUsers.jsp"
                   redirect="false"/>
   
       <forward        name="Users List Setup"
  -                    path="/users/listUsers.do"
  +                    path="/users/listUsers.do?forward=Users+List"
                   redirect="false"/>
   
       <!-- ========== ==================== ========== -->
   
  +
     </global-forwards>
   
   
  @@ -427,18 +450,33 @@
   
       <!-- ========== User Database Module ========== -->
   
  +    <action    path="/users/deleteGroups"
  +               name="groupsForm"
  +              scope="request"
  +               type="org.apache.webapp.admin.users.DeleteGroupsAction"/>
  +
  +    <action    path="/users/deleteRoles"
  +               name="rolesForm"
  +              scope="request"
  +                type="org.apache.webapp.admin.users.DeleteRolesAction"/>
  +
  +    <action    path="/users/deleteUsers"
  +               name="usersForm"
  +              scope="request"
  +               type="org.apache.webapp.admin.users.DeleteUsersAction"/>
  +
       <action    path="/users/listGroups"
  -               name="databaseForm"
  +               name="groupsForm"
                 scope="request"
                  type="org.apache.webapp.admin.users.ListGroupsAction"/>
   
       <action    path="/users/listRoles"
  -               name="databaseForm"
  +               name="rolesForm"
                 scope="request"
                  type="org.apache.webapp.admin.users.ListRolesAction"/>
   
       <action    path="/users/listUsers"
  -               name="databaseForm"
  +               name="usersForm"
                 scope="request"
                  type="org.apache.webapp.admin.users.ListUsersAction"/>
   
  
  
  
  1.25      +6 -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.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- ApplicationResources_en.properties	10 Feb 2002 03:14:11 -0000	1.24
  +++ ApplicationResources_en.properties	10 Feb 2002 05:48:57 -0000	1.25
  @@ -177,10 +177,16 @@
   # ---------- User Database Module ----------
   users.actions.group.create=Create New Group
   users.actions.group.delete=Delete Existing Groups
  +users.actions.group.list=List Existing Groups
   users.actions.role.create=Create New Role
   users.actions.role.delete=Delete Existing Roles
  +users.actions.role.list=List Existing Roles
   users.actions.user.create=Create New User
   users.actions.user.delete=Delete Existing Users
  +users.actions.user.list=List Existing Users
  +users.deleteGroups.title=Delete Existing Groups
  +users.deleteRoles.title=Delete Existing Roles
  +users.deleteUsers.title=Delete Existing Users
   users.error.attribute.get=Error retrieving attribute {0}
   users.error.attribute.set=Error modifying attribute {0}
   users.error.invoke=Error invoking operation {0}
  
  
  
  1.2       +67 -30    jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/users/ListGroupsAction.java
  
  Index: ListGroupsAction.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/users/ListGroupsAction.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ListGroupsAction.java	10 Feb 2002 03:18:37 -0000	1.1
  +++ ListGroupsAction.java	10 Feb 2002 05:48:57 -0000	1.2
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/users/ListGroupsAction.java,v 1.1 2002/02/10 03:18:37 craigmcc Exp $
  - * $Revision: 1.1 $
  - * $Date: 2002/02/10 03:18:37 $
  + * $Header: /home/cvs/jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/users/ListGroupsAction.java,v 1.2 2002/02/10 05:48:57 craigmcc Exp $
  + * $Revision: 1.2 $
  + * $Date: 2002/02/10 05:48:57 $
    *
    * ====================================================================
    *
  @@ -64,35 +64,58 @@
   
   
   import java.io.IOException;
  -import java.util.ArrayList;
  -import java.util.Iterator;
  -import java.util.Set;
  -import java.util.TreeSet;
  +import java.net.URLDecoder;
  +import java.util.Arrays;
  +import java.util.Locale;
   import javax.management.MBeanServer;
   import javax.management.ObjectName;
   import javax.management.modelmbean.ModelMBean;
   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.ActionForm;
   import org.apache.struts.action.ActionForward;
   import org.apache.struts.action.ActionMapping;
  +import org.apache.struts.util.MessageResources;
   import org.apache.webapp.admin.ApplicationServlet;
   
   
   /**
  - * Retrieve the Set of MBean namess for all currently defined groups,
  - * and expose them as a request attribute named "groups".
  + * <p>Retrieve the set of MBean names for all currently defined groups,
  + * and expose them in a request attribute named "groupsForm".  This action
  + * requires the following request parameters to be set:</p>
  + * <ul>
  + * <li><strong>databaseName</strong> - Object name of the UserDatabase
  + *     MBean from which we should retrieve the groups list.</li>
  + * <li><strong>forward</strong> - Global forward to which we should
  + *     go after stashing the groups list.</li>
  + * </ul>
    *
    * @author Craig R. McClanahan
  - * @version $Revision: 1.1 $ $Date: 2002/02/10 03:18:37 $
  + * @version $Revision: 1.2 $ $Date: 2002/02/10 05:48:57 $
    * @since 4.1
    */
   
   public class ListGroupsAction extends Action {
   
   
  +    // ----------------------------------------------------- Instance Variables
  +
  +
  +    /**
  +     * The MBeanServer we will be interacting with.
  +     */
  +    private MBeanServer mserver = null;
  +
  +
  +    /**
  +     * The MessageResources we will be retrieving messages from.
  +     */
  +    private MessageResources resources = null;
  +
  +
       // --------------------------------------------------------- Public Methods
   
   
  @@ -118,34 +141,48 @@
           throws IOException, ServletException {
   
   
  -        // Acquire a reference to the MBeanServer containing our MBeans
  -        MBeanServer mserver = null;
  -        try {
  +        // Look up the components we will be using as needed
  +        if (mserver == null) {
               mserver = ((ApplicationServlet) getServlet()).getServer();
  -        } catch (Throwable t) {
  -            throw new ServletException
  -                ("Cannot acquire MBeanServer reference", t);
           }
  +        if (resources == null) {
  +            resources = getServlet().getResources();
  +        }
  +        HttpSession session = request.getSession();
  +        Locale locale = (Locale) session.getAttribute(Action.LOCALE_KEY);
  +
   
  -        // Acquire the set of group MBean names to be listed
  -        // FIXME - limit to global user database?
  -        String pattern = "Users:type=Group,*";
  -        Set results = null;
  +        // Acquire the set of group object names to be listed
  +        String databaseName =
  +            URLDecoder.decode(request.getParameter("databaseName"));
  +        String results[] = null;
           try {
  -            results = mserver.queryNames(new ObjectName(pattern), null);
  +            ObjectName dname = new ObjectName(databaseName);
  +            results =
  +                (String[]) mserver.getAttribute(dname, "groups");
  +            if (results == null) {
  +                results = new String[0];
  +            }
  +            Arrays.sort(results);
           } catch (Throwable t) {
  -            throw new ServletException("queryNames(" + pattern + ")", t);
  -        }
  -        TreeSet groups = new TreeSet();
  -        Iterator names = results.iterator();
  -        while (names.hasNext()) {
  -            ObjectName name = (ObjectName) names.next();
  -            groups.add(name.toString());
  +            getServlet().log(resources.getMessage
  +                             (locale,
  +                              "users.error.attribute.get", "groups"), t);
  +            response.sendError
  +                (HttpServletResponse.SC_INTERNAL_SERVER_ERROR,
  +                 resources.getMessage
  +                 (locale, "users.error.attribute.get", "groups"));
           }
   
  -        // Forward the Set as a request attribute
  -        request.setAttribute("groups", groups);
  -        return (mapping.findForward("Groups List"));
  +        // Stash the results in a form bean
  +        GroupsForm groupsForm = new GroupsForm();
  +        groupsForm.setDatabaseName(databaseName);
  +        groupsForm.setGroups(results);
  +        request.setAttribute("groupsForm", groupsForm);
  +        saveToken(request);
  +        String forward =
  +            URLDecoder.decode(request.getParameter("forward"));
  +        return (mapping.findForward(forward));
   
       }
   
  
  
  
  1.2       +67 -34    jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/users/ListRolesAction.java
  
  Index: ListRolesAction.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/users/ListRolesAction.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ListRolesAction.java	10 Feb 2002 03:18:37 -0000	1.1
  +++ ListRolesAction.java	10 Feb 2002 05:48:57 -0000	1.2
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/users/ListRolesAction.java,v 1.1 2002/02/10 03:18:37 craigmcc Exp $
  - * $Revision: 1.1 $
  - * $Date: 2002/02/10 03:18:37 $
  + * $Header: /home/cvs/jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/users/ListRolesAction.java,v 1.2 2002/02/10 05:48:57 craigmcc Exp $
  + * $Revision: 1.2 $
  + * $Date: 2002/02/10 05:48:57 $
    *
    * ====================================================================
    *
  @@ -64,37 +64,58 @@
   
   
   import java.io.IOException;
  -import java.util.ArrayList;
  -import java.util.Iterator;
  -import java.util.Set;
  -import java.util.TreeSet;
  +import java.net.URLDecoder;
  +import java.util.Arrays;
  +import java.util.Locale;
   import javax.management.MBeanServer;
   import javax.management.ObjectName;
   import javax.management.modelmbean.ModelMBean;
   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.ActionForm;
   import org.apache.struts.action.ActionForward;
   import org.apache.struts.action.ActionMapping;
  +import org.apache.struts.util.MessageResources;
   import org.apache.webapp.admin.ApplicationServlet;
   
   
   /**
  - * Retrieve the Set of MBean namess for all currently defined roles,
  - * and expose them as a request attribute named "roles".  Requires a
  - * request parameter <code>databaseName</code> containing the MBean
  - * Name of our associated UserDatabase instance.
  + * <p>Retrieve the set of MBean names for all currently defined roles,
  + * and expose them in a request attribute named "rolesForm".  This action
  + * requires the following request parameters to be set:</p>
  + * <ul>
  + * <li><strong>databaseName</strong> - Object name of the UserDatabase
  + *     MBean from which we should retrieve the roles list.</li>
  + * <li><strong>forward</strong> - Global forward to which we should
  + *     go after stashing the roles list.</li>
  + * </ul>
    *
    * @author Craig R. McClanahan
  - * @version $Revision: 1.1 $ $Date: 2002/02/10 03:18:37 $
  + * @version $Revision: 1.2 $ $Date: 2002/02/10 05:48:57 $
    * @since 4.1
    */
   
   public class ListRolesAction extends Action {
   
   
  +    // ----------------------------------------------------- Instance Variables
  +
  +
  +    /**
  +     * The MBeanServer we will be interacting with.
  +     */
  +    private MBeanServer mserver = null;
  +
  +
  +    /**
  +     * The MessageResources we will be retrieving messages from.
  +     */
  +    private MessageResources resources = null;
  +
  +
       // --------------------------------------------------------- Public Methods
   
   
  @@ -120,36 +141,48 @@
           throws IOException, ServletException {
   
   
  -        // Acquire a reference to the MBeanServer containing our MBeans
  -        MBeanServer mserver = null;
  -        try {
  +        // Look up the components we will be using as needed
  +        if (mserver == null) {
               mserver = ((ApplicationServlet) getServlet()).getServer();
  -        } catch (Throwable t) {
  -            throw new ServletException
  -                ("Cannot acquire MBeanServer reference", t);
           }
  +        if (resources == null) {
  +            resources = getServlet().getResources();
  +        }
  +        HttpSession session = request.getSession();
  +        Locale locale = (Locale) session.getAttribute(Action.LOCALE_KEY);
  +
   
  -        // Acquire the set of user MBean names to be listed
  -        // FIXME - limit to global user database
  -        // FIXME - pass databaseName reference on
  -        // FIXME - set transaction control token
  -        String pattern = "Users:type=Role,*";
  -        Set results = null;
  +        // Acquire the set of role object names to be listed
  +        String databaseName =
  +            URLDecoder.decode(request.getParameter("databaseName"));
  +        String results[] = null;
           try {
  -            results = mserver.queryNames(new ObjectName(pattern), null);
  +            ObjectName dname = new ObjectName(databaseName);
  +            results =
  +                (String[]) mserver.getAttribute(dname, "roles");
  +            if (results == null) {
  +                results = new String[0];
  +            }
  +            Arrays.sort(results);
           } catch (Throwable t) {
  -            throw new ServletException("queryNames(" + pattern + ")", t);
  -        }
  -        TreeSet roles = new TreeSet();
  -        Iterator names = results.iterator();
  -        while (names.hasNext()) {
  -            ObjectName name = (ObjectName) names.next();
  -            roles.add(name.toString());
  +            getServlet().log(resources.getMessage
  +                             (locale,
  +                              "users.error.attribute.get", "roles"), t);
  +            response.sendError
  +                (HttpServletResponse.SC_INTERNAL_SERVER_ERROR,
  +                 resources.getMessage
  +                 (locale, "users.error.attribute.get", "roles"));
           }
   
  -        // Forward the Set as a request attribute
  -        request.setAttribute("roles", roles);
  -        return (mapping.findForward("Roles List"));
  +        // Stash the results in a form bean
  +        RolesForm rolesForm = new RolesForm();
  +        rolesForm.setDatabaseName(databaseName);
  +        rolesForm.setRoles(results);
  +        request.setAttribute("rolesForm", rolesForm);
  +        saveToken(request);
  +        String forward =
  +            URLDecoder.decode(request.getParameter("forward"));
  +        return (mapping.findForward(forward));
   
       }
   
  
  
  
  1.2       +67 -30    jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/users/ListUsersAction.java
  
  Index: ListUsersAction.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/users/ListUsersAction.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ListUsersAction.java	10 Feb 2002 03:18:37 -0000	1.1
  +++ ListUsersAction.java	10 Feb 2002 05:48:57 -0000	1.2
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/users/ListUsersAction.java,v 1.1 2002/02/10 03:18:37 craigmcc Exp $
  - * $Revision: 1.1 $
  - * $Date: 2002/02/10 03:18:37 $
  + * $Header: /home/cvs/jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/users/ListUsersAction.java,v 1.2 2002/02/10 05:48:57 craigmcc Exp $
  + * $Revision: 1.2 $
  + * $Date: 2002/02/10 05:48:57 $
    *
    * ====================================================================
    *
  @@ -64,35 +64,58 @@
   
   
   import java.io.IOException;
  -import java.util.ArrayList;
  -import java.util.Iterator;
  -import java.util.Set;
  -import java.util.TreeSet;
  +import java.net.URLDecoder;
  +import java.util.Arrays;
  +import java.util.Locale;
   import javax.management.MBeanServer;
   import javax.management.ObjectName;
   import javax.management.modelmbean.ModelMBean;
   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.ActionForm;
   import org.apache.struts.action.ActionForward;
   import org.apache.struts.action.ActionMapping;
  +import org.apache.struts.util.MessageResources;
   import org.apache.webapp.admin.ApplicationServlet;
   
   
   /**
  - * Retrieve the Set of MBean namess for all currently defined users,
  - * and expose them as a request attribute named "users".
  + * <p>Retrieve the set of MBean names for all currently defined users,
  + * and expose them in a request attribute named "usersForm".  This action
  + * requires the following request parameters to be set:</p>
  + * <ul>
  + * <li><strong>databaseName</strong> - Object name of the UserDatabase
  + *     MBean from which we should retrieve the users list.</li>
  + * <li><strong>forward</strong> - Global forward to which we should
  + *     go after stashing the users list.</li>
  + * </ul>
    *
    * @author Craig R. McClanahan
  - * @version $Revision: 1.1 $ $Date: 2002/02/10 03:18:37 $
  + * @version $Revision: 1.2 $ $Date: 2002/02/10 05:48:57 $
    * @since 4.1
    */
   
   public class ListUsersAction extends Action {
   
   
  +    // ----------------------------------------------------- Instance Variables
  +
  +
  +    /**
  +     * The MBeanServer we will be interacting with.
  +     */
  +    private MBeanServer mserver = null;
  +
  +
  +    /**
  +     * The MessageResources we will be retrieving messages from.
  +     */
  +    private MessageResources resources = null;
  +
  +
       // --------------------------------------------------------- Public Methods
   
   
  @@ -118,34 +141,48 @@
           throws IOException, ServletException {
   
   
  -        // Acquire a reference to the MBeanServer containing our MBeans
  -        MBeanServer mserver = null;
  -        try {
  +        // Look up the components we will be using as needed
  +        if (mserver == null) {
               mserver = ((ApplicationServlet) getServlet()).getServer();
  -        } catch (Throwable t) {
  -            throw new ServletException
  -                ("Cannot acquire MBeanServer reference", t);
           }
  +        if (resources == null) {
  +            resources = getServlet().getResources();
  +        }
  +        HttpSession session = request.getSession();
  +        Locale locale = (Locale) session.getAttribute(Action.LOCALE_KEY);
  +
   
  -        // Acquire the set of user MBean names to be listed
  -        // FIXME - limit to global user database?
  -        String pattern = "Users:type=User,*";
  -        Set results = null;
  +        // Acquire the set of user object names to be listed
  +        String databaseName =
  +            URLDecoder.decode(request.getParameter("databaseName"));
  +        String results[] = null;
           try {
  -            results = mserver.queryNames(new ObjectName(pattern), null);
  +            ObjectName dname = new ObjectName(databaseName);
  +            results =
  +                (String[]) mserver.getAttribute(dname, "users");
  +            if (results == null) {
  +                results = new String[0];
  +            }
  +            Arrays.sort(results);
           } catch (Throwable t) {
  -            throw new ServletException("queryNames(" + pattern + ")", t);
  -        }
  -        TreeSet users = new TreeSet();
  -        Iterator names = results.iterator();
  -        while (names.hasNext()) {
  -            ObjectName name = (ObjectName) names.next();
  -            users.add(name.toString());
  +            getServlet().log(resources.getMessage
  +                             (locale,
  +                              "users.error.attribute.get", "users"), t);
  +            response.sendError
  +                (HttpServletResponse.SC_INTERNAL_SERVER_ERROR,
  +                 resources.getMessage
  +                 (locale, "users.error.attribute.get", "users"));
           }
   
  -        // Forward the Set as a request attribute
  -        request.setAttribute("users", users);
  -        return (mapping.findForward("Users List"));
  +        // Stash the results in a form bean
  +        UsersForm usersForm = new UsersForm();
  +        usersForm.setDatabaseName(databaseName);
  +        usersForm.setUsers(results);
  +        request.setAttribute("usersForm", usersForm);
  +        saveToken(request);
  +        String forward =
  +            URLDecoder.decode(request.getParameter("forward"));
  +        return (mapping.findForward(forward));
   
       }
   
  
  
  
  1.2       +6 -4      jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/users/SaveGroupAction.java
  
  Index: SaveGroupAction.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/users/SaveGroupAction.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- SaveGroupAction.java	10 Feb 2002 03:18:37 -0000	1.1
  +++ SaveGroupAction.java	10 Feb 2002 05:48:57 -0000	1.2
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/users/SaveGroupAction.java,v 1.1 2002/02/10 03:18:37 craigmcc Exp $
  - * $Revision: 1.1 $
  - * $Date: 2002/02/10 03:18:37 $
  + * $Header: /home/cvs/jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/users/SaveGroupAction.java,v 1.2 2002/02/10 05:48:57 craigmcc Exp $
  + * $Revision: 1.2 $
  + * $Date: 2002/02/10 05:48:57 $
    *
    * ====================================================================
    *
  @@ -64,6 +64,7 @@
   
   
   import java.io.IOException;
  +import java.net.URLDecoder;
   import java.util.ArrayList;
   import java.util.Iterator;
   import java.util.Locale;
  @@ -96,7 +97,7 @@
    * updated Group back to the underlying database.</p>
    *
    * @author Craig R. McClanahan
  - * @version $Revision: 1.1 $ $Date: 2002/02/10 03:18:37 $
  + * @version $Revision: 1.2 $ $Date: 2002/02/10 05:48:57 $
    * @since 4.1
    */
   
  @@ -167,7 +168,8 @@
   
           // Perform any extra validation that is required
           GroupForm groupForm = (GroupForm) form;
  -        String databaseName = groupForm.getDatabaseName();
  +        String databaseName =
  +            URLDecoder.decode(groupForm.getDatabaseName());
           String objectName = groupForm.getObjectName();
   
           // Perform an "Add Group" transaction
  
  
  
  1.2       +6 -4      jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/users/SaveRoleAction.java
  
  Index: SaveRoleAction.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/users/SaveRoleAction.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- SaveRoleAction.java	10 Feb 2002 03:18:37 -0000	1.1
  +++ SaveRoleAction.java	10 Feb 2002 05:48:57 -0000	1.2
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/users/SaveRoleAction.java,v 1.1 2002/02/10 03:18:37 craigmcc Exp $
  - * $Revision: 1.1 $
  - * $Date: 2002/02/10 03:18:37 $
  + * $Header: /home/cvs/jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/users/SaveRoleAction.java,v 1.2 2002/02/10 05:48:57 craigmcc Exp $
  + * $Revision: 1.2 $
  + * $Date: 2002/02/10 05:48:57 $
    *
    * ====================================================================
    *
  @@ -64,6 +64,7 @@
   
   
   import java.io.IOException;
  +import java.net.URLDecoder;
   import java.util.ArrayList;
   import java.util.Iterator;
   import java.util.Locale;
  @@ -96,7 +97,7 @@
    * updated Role back to the underlying database.</p>
    *
    * @author Craig R. McClanahan
  - * @version $Revision: 1.1 $ $Date: 2002/02/10 03:18:37 $
  + * @version $Revision: 1.2 $ $Date: 2002/02/10 05:48:57 $
    * @since 4.1
    */
   
  @@ -167,7 +168,8 @@
   
           // Perform any extra validation that is required
           RoleForm roleForm = (RoleForm) form;
  -        String databaseName = roleForm.getDatabaseName();
  +        String databaseName =
  +            URLDecoder.decode(roleForm.getDatabaseName());
           String objectName = roleForm.getObjectName();
   
           // Perform an "Add Role" transaction
  
  
  
  1.2       +6 -4      jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/users/SaveUserAction.java
  
  Index: SaveUserAction.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/users/SaveUserAction.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- SaveUserAction.java	10 Feb 2002 03:18:37 -0000	1.1
  +++ SaveUserAction.java	10 Feb 2002 05:48:57 -0000	1.2
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/users/SaveUserAction.java,v 1.1 2002/02/10 03:18:37 craigmcc Exp $
  - * $Revision: 1.1 $
  - * $Date: 2002/02/10 03:18:37 $
  + * $Header: /home/cvs/jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/users/SaveUserAction.java,v 1.2 2002/02/10 05:48:57 craigmcc Exp $
  + * $Revision: 1.2 $
  + * $Date: 2002/02/10 05:48:57 $
    *
    * ====================================================================
    *
  @@ -64,6 +64,7 @@
   
   
   import java.io.IOException;
  +import java.net.URLDecoder;
   import java.util.ArrayList;
   import java.util.Iterator;
   import java.util.Locale;
  @@ -96,7 +97,7 @@
    * updated User back to the underlying database.</p>
    *
    * @author Craig R. McClanahan
  - * @version $Revision: 1.1 $ $Date: 2002/02/10 03:18:37 $
  + * @version $Revision: 1.2 $ $Date: 2002/02/10 05:48:57 $
    * @since 4.1
    */
   
  @@ -167,7 +168,8 @@
   
           // Perform any extra validation that is required
           UserForm userForm = (UserForm) form;
  -        String databaseName = userForm.getDatabaseName();
  +        String databaseName =
  +            URLDecoder.decode(userForm.getDatabaseName());
           String objectName = userForm.getObjectName();
   
           // Perform an "Add User" transaction
  
  
  
  1.2       +15 -6     jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/users/UsersTreeBuilder.java
  
  Index: UsersTreeBuilder.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/users/UsersTreeBuilder.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- UsersTreeBuilder.java	10 Feb 2002 03:18:38 -0000	1.1
  +++ UsersTreeBuilder.java	10 Feb 2002 05:48:57 -0000	1.2
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/users/UsersTreeBuilder.java,v 1.1 2002/02/10 03:18:38 craigmcc Exp $
  - * $Revision: 1.1 $
  - * $Date: 2002/02/10 03:18:38 $
  + * $Header: /home/cvs/jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/users/UsersTreeBuilder.java,v 1.2 2002/02/10 05:48:57 craigmcc Exp $
  + * $Revision: 1.2 $
  + * $Date: 2002/02/10 05:48:57 $
    *
    * ====================================================================
    *
  @@ -77,7 +77,7 @@
    * for administering the user database.
    *
    * @author Craig R. McClanahan
  - * @version $Revision: 1.1 $ $Date: 2002/02/10 03:18:38 $
  + * @version $Revision: 1.2 $ $Date: 2002/02/10 05:48:57 $
    * @since 4.1
    */
   
  @@ -137,21 +137,30 @@
               ("Global Administer Groups",
                "folder_16_pad.gif",
                resources.getMessage("users.treeBuilder.groupsNode"),
  -             "users/listGroups.do?databaseName=" + databaseName,
  +             "users/listGroups.do?databaseName=" +
  +             URLEncoder.encode(databaseName) +
  +             "&forward=" +
  +             URLEncoder.encode("Groups List Setup"),
                "content",
                false);
           TreeControlNode roles = new TreeControlNode
               ("Global Administer Roles",
                "folder_16_pad.gif",
                resources.getMessage("users.treeBuilder.rolesNode"),
  -             "users/listRoles.do?databaseName=" + databaseName,
  +             "users/listRoles.do?databaseName=" +
  +             URLEncoder.encode(databaseName) +
  +             "&forward=" +
  +             URLEncoder.encode("Roles List Setup"),
                "content",
                false);
           TreeControlNode users = new TreeControlNode
               ("Global Administer Users",
                "folder_16_pad.gif",
                resources.getMessage("users.treeBuilder.usersNode"),
  -             "users/listUsers.do?databaseName=" + databaseName,
  +             "users/listUsers.do?databaseName=" +
  +             URLEncoder.encode(databaseName) +
  +             "&forward=" +
  +             URLEncoder.encode("Users List Setup"),
                "content",
                false);
   
  
  
  
  1.1                  jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/users/DeleteGroupsAction.java
  
  Index: DeleteGroupsAction.java
  ===================================================================
  /*
   * $Header: /home/cvs/jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/users/DeleteGroupsAction.java,v 1.1 2002/02/10 05:48:57 craigmcc Exp $
   * $Revision: 1.1 $
   * $Date: 2002/02/10 05:48:57 $
   *
   * ====================================================================
   *
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2002 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.users;
  
  
  import java.io.IOException;
  import java.util.ArrayList;
  import java.util.Iterator;
  import java.util.Locale;
  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.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;
  
  
  /**
   * <p>Implementation of <strong>Action</strong> that deletes the
   * specified set of groups.</p>
   *
   * @author Craig R. McClanahan
   * @version $Revision: 1.1 $ $Date: 2002/02/10 05:48:57 $
   * @since 4.1
   */
  
  public final class DeleteGroupsAction extends Action {
  
  
      // ----------------------------------------------------- Instance Variables
  
  
      /**
       * The MBeanServer we will be interacting with.
       */
      private MBeanServer mserver = 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 {
  
          // Look up the components we will be using as needed
          if (mserver == null) {
              mserver = ((ApplicationServlet) getServlet()).getServer();
          }
          if (resources == null) {
              resources = getServlet().getResources();
          }
          HttpSession session = request.getSession();
          Locale locale = (Locale) session.getAttribute(Action.LOCALE_KEY);
  
          // Has this transaction been cancelled?
          if (isCancelled(request)) {
              return (mapping.findForward("List Groups Setup"));
          }
  
          // Check the transaction token
          if (!isTokenValid(request)) {
              response.sendError
                  (HttpServletResponse.SC_BAD_REQUEST,
                   resources.getMessage(locale, "users.error.token"));
              return (null);
          }
  
          // Perform any extra validation that is required
          GroupsForm groupsForm = (GroupsForm) form;
          String databaseName = groupsForm.getDatabaseName();
          String groups[] = groupsForm.getGroups();
          if (groups == null) {
              groups = new String[0];
          }
  
          // Perform "Delete Group" transactions as required
          try {
  
              ObjectName dname = new ObjectName(databaseName);
              String signature[] = new String[1];
              signature[0] = "java.lang.String";
              Object params[] = new String[1];
  
              for (int i = 0; i < groups.length; i++) {
                  ObjectName oname = new ObjectName(groups[i]);
                  params[0] = oname.getKeyProperty("groupname");
                  mserver.invoke(dname, "removeGroup",
                                 params, signature);
              }
  
          } catch (Throwable t) {
  
              getServlet().log
                  (resources.getMessage(locale, "users.error.invoke",
                                        "removeGroup"), t);
              response.sendError
                  (HttpServletResponse.SC_INTERNAL_SERVER_ERROR,
                   resources.getMessage(locale, "users.error.invoke",
                                        "removeGroup"));
              return (null);
  
          }
  
          // Save the updated database information
          try {
  
              ObjectName dname = new ObjectName(databaseName);
              mserver.invoke(dname, "save",
                             new Object[0], new String[0]);
  
          } catch (Throwable t) {
  
              getServlet().log
                  (resources.getMessage(locale, "users.error.invoke",
                                        "save"), t);
              response.sendError
                  (HttpServletResponse.SC_INTERNAL_SERVER_ERROR,
                   resources.getMessage(locale, "users.error.invoke",
                                        "save"));
              return (null);
  
          }
  
          // Proceed to the list groups screen
          return (mapping.findForward("Groups List Setup"));
  
      }
  
  
  }
  
  
  
  1.1                  jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/users/DeleteRolesAction.java
  
  Index: DeleteRolesAction.java
  ===================================================================
  /*
   * $Header: /home/cvs/jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/users/DeleteRolesAction.java,v 1.1 2002/02/10 05:48:57 craigmcc Exp $
   * $Revision: 1.1 $
   * $Date: 2002/02/10 05:48:57 $
   *
   * ====================================================================
   *
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2002 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.users;
  
  
  import java.io.IOException;
  import java.util.ArrayList;
  import java.util.Iterator;
  import java.util.Locale;
  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.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;
  
  
  /**
   * <p>Implementation of <strong>Action</strong> that deletes the
   * specified set of roles.</p>
   *
   * @author Craig R. McClanahan
   * @version $Revision: 1.1 $ $Date: 2002/02/10 05:48:57 $
   * @since 4.1
   */
  
  public final class DeleteRolesAction extends Action {
  
  
      // ----------------------------------------------------- Instance Variables
  
  
      /**
       * The MBeanServer we will be interacting with.
       */
      private MBeanServer mserver = 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 {
  
          // Look up the components we will be using as needed
          if (mserver == null) {
              mserver = ((ApplicationServlet) getServlet()).getServer();
          }
          if (resources == null) {
              resources = getServlet().getResources();
          }
          HttpSession session = request.getSession();
          Locale locale = (Locale) session.getAttribute(Action.LOCALE_KEY);
  
          // Has this transaction been cancelled?
          if (isCancelled(request)) {
              return (mapping.findForward("List Roles Setup"));
          }
  
          // Check the transaction token
          if (!isTokenValid(request)) {
              response.sendError
                  (HttpServletResponse.SC_BAD_REQUEST,
                   resources.getMessage(locale, "users.error.token"));
              return (null);
          }
  
          // Perform any extra validation that is required
          RolesForm rolesForm = (RolesForm) form;
          String databaseName = rolesForm.getDatabaseName();
          String roles[] = rolesForm.getRoles();
          if (roles == null) {
              roles = new String[0];
          }
  
          // Perform "Delete Role" transactions as required
          try {
  
              ObjectName dname = new ObjectName(databaseName);
              String signature[] = new String[1];
              signature[0] = "java.lang.String";
              Object params[] = new String[1];
  
              for (int i = 0; i < roles.length; i++) {
                  ObjectName oname = new ObjectName(roles[i]);
                  params[0] = oname.getKeyProperty("rolename");
                  mserver.invoke(dname, "removeRole",
                                 params, signature);
              }
  
          } catch (Throwable t) {
  
              getServlet().log
                  (resources.getMessage(locale, "users.error.invoke",
                                        "removeRole"), t);
              response.sendError
                  (HttpServletResponse.SC_INTERNAL_SERVER_ERROR,
                   resources.getMessage(locale, "users.error.invoke",
                                        "removeRole"));
              return (null);
  
          }
  
          // Save the updated database information
          try {
  
              ObjectName dname = new ObjectName(databaseName);
              mserver.invoke(dname, "save",
                             new Object[0], new String[0]);
  
          } catch (Throwable t) {
  
              getServlet().log
                  (resources.getMessage(locale, "users.error.invoke",
                                        "save"), t);
              response.sendError
                  (HttpServletResponse.SC_INTERNAL_SERVER_ERROR,
                   resources.getMessage(locale, "users.error.invoke",
                                        "save"));
              return (null);
  
          }
  
          // Proceed to the list roles screen
          return (mapping.findForward("Roles List Setup"));
  
      }
  
  
  }
  
  
  
  1.1                  jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/users/DeleteUsersAction.java
  
  Index: DeleteUsersAction.java
  ===================================================================
  /*
   * $Header: /home/cvs/jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/users/DeleteUsersAction.java,v 1.1 2002/02/10 05:48:57 craigmcc Exp $
   * $Revision: 1.1 $
   * $Date: 2002/02/10 05:48:57 $
   *
   * ====================================================================
   *
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2002 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.users;
  
  
  import java.io.IOException;
  import java.util.ArrayList;
  import java.util.Iterator;
  import java.util.Locale;
  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.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;
  
  
  /**
   * <p>Implementation of <strong>Action</strong> that deletes the
   * specified set of users.</p>
   *
   * @author Craig R. McClanahan
   * @version $Revision: 1.1 $ $Date: 2002/02/10 05:48:57 $
   * @since 4.1
   */
  
  public final class DeleteUsersAction extends Action {
  
  
      // ----------------------------------------------------- Instance Variables
  
  
      /**
       * The MBeanServer we will be interacting with.
       */
      private MBeanServer mserver = 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 {
  
          // Look up the components we will be using as needed
          if (mserver == null) {
              mserver = ((ApplicationServlet) getServlet()).getServer();
          }
          if (resources == null) {
              resources = getServlet().getResources();
          }
          HttpSession session = request.getSession();
          Locale locale = (Locale) session.getAttribute(Action.LOCALE_KEY);
  
          // Has this transaction been cancelled?
          if (isCancelled(request)) {
              return (mapping.findForward("List Users Setup"));
          }
  
          // Check the transaction token
          if (!isTokenValid(request)) {
              response.sendError
                  (HttpServletResponse.SC_BAD_REQUEST,
                   resources.getMessage(locale, "users.error.token"));
              return (null);
          }
  
          // Perform any extra validation that is required
          UsersForm usersForm = (UsersForm) form;
          String databaseName = usersForm.getDatabaseName();
          String users[] = usersForm.getUsers();
          if (users == null) {
              users = new String[0];
          }
  
          // Perform "Delete User" transactions as required
          try {
  
              ObjectName dname = new ObjectName(databaseName);
              String signature[] = new String[1];
              signature[0] = "java.lang.String";
              Object params[] = new String[1];
  
              for (int i = 0; i < users.length; i++) {
                  ObjectName oname = new ObjectName(users[i]);
                  params[0] = oname.getKeyProperty("username");
                  mserver.invoke(dname, "removeUser",
                                 params, signature);
              }
  
          } catch (Throwable t) {
  
              getServlet().log
                  (resources.getMessage(locale, "users.error.invoke",
                                        "removeUser"), t);
              response.sendError
                  (HttpServletResponse.SC_INTERNAL_SERVER_ERROR,
                   resources.getMessage(locale, "users.error.invoke",
                                        "removeUser"));
              return (null);
  
          }
  
          // Save the updated database information
          try {
  
              ObjectName dname = new ObjectName(databaseName);
              mserver.invoke(dname, "save",
                             new Object[0], new String[0]);
  
          } catch (Throwable t) {
  
              getServlet().log
                  (resources.getMessage(locale, "users.error.invoke",
                                        "save"), t);
              response.sendError
                  (HttpServletResponse.SC_INTERNAL_SERVER_ERROR,
                   resources.getMessage(locale, "users.error.invoke",
                                        "save"));
              return (null);
  
          }
  
          // Proceed to the list users screen
          return (mapping.findForward("Users List Setup"));
  
      }
  
  
  }
  
  
  
  1.1                  jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/users/GroupsForm.java
  
  Index: GroupsForm.java
  ===================================================================
  /*
   * $Header: /home/cvs/jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/users/GroupsForm.java,v 1.1 2002/02/10 05:48:57 craigmcc Exp $
   * $Revision: 1.1 $
   * $Date: 2002/02/10 05:48:57 $
   *
   * ====================================================================
   *
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2002 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.users;
  
  
  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;
  
  
  /**
   * Form bean for the delete groups page.
   *
   * @author Craig R. McClanahan
   * @version $Revision: 1.1 $ $Date: 2002/02/10 05:48:57 $
   * @since 4.1
   */
  
  public final class GroupsForm extends BaseForm {
  
  
      // ----------------------------------------------------- Instance Variables
  
  
      // ------------------------------------------------------------- Properties
  
  
      /**
       * The object names of the specified groups.
       */
      private String groups[] = null;
  
      public String[] getGroups() {
          return (this.groups);
      }
  
      public void setGroups(String groups[]) {
          this.groups = groups;
      }
  
  
      // --------------------------------------------------------- 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) {
  
          super.reset(mapping, request);
          this.groups = null;
  
      }
  
  
  }
  
  
  
  1.1                  jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/users/RolesForm.java
  
  Index: RolesForm.java
  ===================================================================
  /*
   * $Header: /home/cvs/jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/users/RolesForm.java,v 1.1 2002/02/10 05:48:57 craigmcc Exp $
   * $Revision: 1.1 $
   * $Date: 2002/02/10 05:48:57 $
   *
   * ====================================================================
   *
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2002 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.users;
  
  
  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;
  
  
  /**
   * Form bean for the delete roles page.
   *
   * @author Craig R. McClanahan
   * @version $Revision: 1.1 $ $Date: 2002/02/10 05:48:57 $
   * @since 4.1
   */
  
  public final class RolesForm extends BaseForm {
  
  
      // ----------------------------------------------------- Instance Variables
  
  
      // ------------------------------------------------------------- Properties
  
  
      /**
       * The object names of the specified roles.
       */
      private String roles[] = null;
  
      public String[] getRoles() {
          return (this.roles);
      }
  
      public void setRoles(String roles[]) {
          this.roles = roles;
      }
  
  
      // --------------------------------------------------------- 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) {
  
          super.reset(mapping, request);
          this.roles = null;
  
      }
  
  
  }
  
  
  
  1.1                  jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/users/UsersForm.java
  
  Index: UsersForm.java
  ===================================================================
  /*
   * $Header: /home/cvs/jakarta-tomcat-4.0/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/users/UsersForm.java,v 1.1 2002/02/10 05:48:57 craigmcc Exp $
   * $Revision: 1.1 $
   * $Date: 2002/02/10 05:48:57 $
   *
   * ====================================================================
   *
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2002 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.users;
  
  
  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;
  
  
  /**
   * Form bean for the delete users page.
   *
   * @author Craig R. McClanahan
   * @version $Revision: 1.1 $ $Date: 2002/02/10 05:48:57 $
   * @since 4.1
   */
  
  public final class UsersForm extends BaseForm {
  
  
      // ----------------------------------------------------- Instance Variables
  
  
      // ------------------------------------------------------------- Properties
  
  
      /**
       * The object names of the specified users.
       */
      private String users[] = null;
  
      public String[] getUsers() {
          return (this.users);
      }
  
      public void setUsers(String users[]) {
          this.users = users;
      }
  
  
      // --------------------------------------------------------- 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) {
  
          super.reset(mapping, request);
          this.users = null;
  
      }
  
  
  }
  
  
  
  1.2       +4 -58     jakarta-tomcat-4.0/webapps/admin/users/listGroups.jsp
  
  Index: listGroups.jsp
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/webapps/admin/users/listGroups.jsp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- listGroups.jsp	10 Feb 2002 03:15:04 -0000	1.1
  +++ listGroups.jsp	10 Feb 2002 05:48:58 -0000	1.2
  @@ -27,24 +27,7 @@
         </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='<%= "/users/setUpGroup.do?databaseName=" +
  -               URLEncoder.encode(request.getParameter("databaseName")) %>'>
  -                <bean:message key="users.actions.group.create"/>
  -              </controls:action>
  -<%--
  -              <controls:action url="">
  -                <bean:message key="users.actions.group.delete"/>
  -              </controls:action>
  ---%>
  -              <!-- add the urls later once those screens get implemented -->
  -            </controls:actions>
  +          <%@ include file="listGroups.jspf" %>
           </div>
         </td>
       </tr>
  @@ -52,46 +35,9 @@
   
   </html:form>
   
  -<%--    <%@ include file="../buttons.jsp" %>    --%>
  -  <br>
  +<br>
  +<%@ include file="groups.jspf" %>
  +<br>
   
  -  <%-- Groups List --%>
  -
  -  <table class="back-table" border="0" cellspacing="0" cellpadding="1" width="100%">
  -    <tr> 
  -      <td> 
  -        <table class="front-table" border="1"
  -         cellspacing="0" cellpadding="0" width="100%">
  -          <tr class="header-row">
  -            <td><div align="left" class="table-header-text">
  -              <bean:message key="users.list.groupname"/>
  -            </div></td>
  -            <td><div align="left" class="table-header-text">
  -              <bean:message key="users.list.description"/>
  -            </div></td>
  -          </tr>
  -          <logic:iterate name="groups" id="group" type="java.lang.String">
  -            <tr class="line-row">
  -              <td><div align="left" class="table-normal-text">&nbsp;
  -                <html:link page='<%= "/users/setUpGroup.do?objectName=" + 
  -                                     URLEncoder.encode(group) %>'>
  -                  <controls:attribute name="group" attribute="groupname"/>
  -                </html:link>
  -              </div></td>
  -              <td><div align="left" class="table-normal-text">&nbsp;
  -                <controls:attribute name="group" attribute="description"/>
  -              </div></td>
  -            </tr>
  -          </logic:iterate>
  -        </table>
  -      </td>
  -    </tr>
  -  </table>
  -
  -<%--   <%@ include file="../buttons.jsp" %>  --%>
  -
  -  <br>
  -
  -<p>&nbsp;</p>
   </body>
   </html:html>
  
  
  
  1.2       +1 -18     jakarta-tomcat-4.0/webapps/admin/users/listRoles.jsp
  
  Index: listRoles.jsp
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/webapps/admin/users/listRoles.jsp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- listRoles.jsp	10 Feb 2002 03:15:04 -0000	1.1
  +++ listRoles.jsp	10 Feb 2002 05:48:58 -0000	1.2
  @@ -27,24 +27,7 @@
         </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='<%= "/users/setUpRole.do?databaseName=" +
  -               URLEncoder.encode(request.getParameter("databaseName")) %>'>
  -                <bean:message key="users.actions.role.create"/>
  -              </controls:action>
  -<%--
  -              <controls:action url="">
  -                <bean:message key="users.actions.role.delete"/>
  -              </controls:action>
  ---%>
  -              <!-- add the urls later once those screens get implemented -->
  -            </controls:actions>
  +          <%@ include file="listRoles.jspf" %>
           </div>
         </td>
       </tr>
  
  
  
  1.2       +4 -58     jakarta-tomcat-4.0/webapps/admin/users/listUsers.jsp
  
  Index: listUsers.jsp
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/webapps/admin/users/listUsers.jsp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- listUsers.jsp	10 Feb 2002 03:15:04 -0000	1.1
  +++ listUsers.jsp	10 Feb 2002 05:48:58 -0000	1.2
  @@ -27,24 +27,7 @@
         </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='<%= "/users/setUpUser.do?databaseName=" +
  -               URLEncoder.encode(request.getParameter("databaseName")) %>'>
  -                <bean:message key="users.actions.user.create"/>
  -              </controls:action>
  -<%--
  -              <controls:action url="">
  -                <bean:message key="users.actions.user.delete"/>
  -              </controls:action>
  ---%>
  -              <!-- add the urls later once those screens get implemented -->
  -            </controls:actions>
  +          <%@ include file="listUsers.jspf" %>
           </div>
         </td>
       </tr>
  @@ -52,46 +35,9 @@
   
   </html:form>
   
  -<%--    <%@ include file="../buttons.jsp" %>    --%>
  -  <br>
  +<br>
  +<%@ include file="users.jspf" %>
  +<br>
   
  -  <%-- Users List --%>
  -
  -  <table class="back-table" border="0" cellspacing="0" cellpadding="1" width="100%">
  -    <tr> 
  -      <td> 
  -        <table class="front-table" border="1"
  -         cellspacing="0" cellpadding="0" width="100%">
  -          <tr class="header-row">
  -            <td><div align="left" class="table-header-text">
  -              <bean:message key="users.list.username"/>
  -            </div></td>
  -            <td><div align="left" class="table-header-text">
  -              <bean:message key="users.list.fullName"/>
  -            </div></td>
  -          </tr>
  -          <logic:iterate name="users" id="user" type="java.lang.String">
  -            <tr class="line-row">
  -              <td><div align="left" class="table-normal-text">&nbsp;
  -                <html:link page='<%= "/users/setUpUser.do?objectName=" + 
  -                                     URLEncoder.encode(user) %>'>
  -                  <controls:attribute name="user" attribute="username"/>
  -                </html:link>
  -              </div></td>
  -              <td><div align="left" class="table-normal-text">&nbsp;
  -                <controls:attribute name="user" attribute="fullName"/>
  -              </div></td>
  -            </tr>
  -          </logic:iterate>
  -        </table>
  -      </td>
  -    </tr>
  -  </table>
  -
  -<%--   <%@ include file="../buttons.jsp" %>  --%>
  -
  -  <br>
  -
  -<p>&nbsp;</p>
   </body>
   </html:html>
  
  
  
  1.2       +8 -6      jakarta-tomcat-4.0/webapps/admin/users/roles.jspf
  
  Index: roles.jspf
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/webapps/admin/users/roles.jspf,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- roles.jspf	10 Feb 2002 03:15:04 -0000	1.1
  +++ roles.jspf	10 Feb 2002 05:48:58 -0000	1.2
  @@ -6,8 +6,8 @@
     <table class="front-table" border="1"
      cellspacing="0" cellpadding="0" width="100%">
       <tr class="header-row">
  -      <logic:present name="roleChecks">
  -        <td><div align="left" class="table-header-text">
  +      <logic:present name="checkboxes">
  +        <td width="5%"><div align="left" class="table-header-text">
             &nbsp;
           </td>
         </logic:present>
  @@ -18,11 +18,13 @@
           <bean:message key="users.list.description"/>
         </div></td>
       </tr>
  -    <logic:iterate name="roles" id="role" type="java.lang.String">
  +    <logic:iterate name="rolesForm" property="roles"
  +                     id="role" type="java.lang.String">
         <tr class="line-row">
  -        <logic:present name="roleChecks">
  -          <td><div align="left" class="table-normal-text">
  -            <input type="checkbox" name="roles">  <%-- FIXME: checks --%>
  +        <logic:present name="checkboxes">
  +          <td><div align="center" class="table-normal-text">
  +            <input type="checkbox" name="roles"
  +                  value="<%= role %>">
             </td>
           </logic:present>
           <td><div align="left" class="table-normal-text">&nbsp;
  
  
  
  1.1                  jakarta-tomcat-4.0/webapps/admin/users/deleteGroups.jsp
  
  Index: deleteGroups.jsp
  ===================================================================
  <!-- Standard Struts Entries -->
  <%@ page language="java" import="java.net.URLEncoder" %>
  <%@ 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="header.jsp" %>
  
  <!-- Body -->
  <body bgcolor="white">
  
  <!--Form -->
  
  <html:errors/>
  
  <html:form action="/users/listGroups">
  
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr bgcolor="7171A5">
        <td width="81%"> 
          <div class="page-title-text" align="left">
            <bean:message key="users.deleteGroups.title"/>
          </div>
        </td>
        <td width="19%"> 
          <div align="right">
            <%@ include file="listGroups.jspf" %>
          </div>
        </td>
      </tr>
    </table>
  
  </html:form>
  
  <br>
  <bean:define id="checkboxes" scope="page" value="true"/>
  <html:form action="/users/deleteGroups">
    <%@ include file="../buttons.jsp" %>
    <br>
    <html:hidden property="databaseName"/>
    <%@ include file="groups.jspf" %>
    <%@ include file="../buttons.jsp" %>
  </html:form>
  <br>
  
  <%@ include file="footer.jsp" %>
  
  </body>
  </html:html>
  
  
  
  1.1                  jakarta-tomcat-4.0/webapps/admin/users/deleteRoles.jsp
  
  Index: deleteRoles.jsp
  ===================================================================
  <!-- Standard Struts Entries -->
  <%@ page language="java" import="java.net.URLEncoder" %>
  <%@ 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="header.jsp" %>
  
  <!-- Body -->
  <body bgcolor="white">
  
  <!--Form -->
  
  <html:errors/>
  
  <html:form action="/users/listRoles">
  
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr bgcolor="7171A5">
        <td width="81%"> 
          <div class="page-title-text" align="left">
            <bean:message key="users.deleteRoles.title"/>
          </div>
        </td>
        <td width="19%"> 
          <div align="right">
            <%@ include file="listRoles.jspf" %>
          </div>
        </td>
      </tr>
    </table>
  
  </html:form>
  
  <br>
  <bean:define id="checkboxes" scope="page" value="true"/>
  <html:form action="/users/deleteRoles">
    <%@ include file="../buttons.jsp" %>
    <br>
    <html:hidden property="databaseName"/>
    <%@ include file="roles.jspf" %>
    <%@ include file="../buttons.jsp" %>
  </html:form>
  <br>
  
  <%@ include file="footer.jsp" %>
  
  </body>
  </html:html>
  
  
  
  1.1                  jakarta-tomcat-4.0/webapps/admin/users/deleteUsers.jsp
  
  Index: deleteUsers.jsp
  ===================================================================
  <!-- Standard Struts Entries -->
  <%@ page language="java" import="java.net.URLEncoder" %>
  <%@ 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="header.jsp" %>
  
  <!-- Body -->
  <body bgcolor="white">
  
  <!--Form -->
  
  <html:errors/>
  
  <html:form action="/users/listUsers">
  
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr bgcolor="7171A5">
        <td width="81%"> 
          <div class="page-title-text" align="left">
            <bean:message key="users.deleteUsers.title"/>
          </div>
        </td>
        <td width="19%"> 
          <div align="right">
            <%@ include file="listUsers.jspf" %>
          </div>
        </td>
      </tr>
    </table>
  
  </html:form>
  
  <br>
  <bean:define id="checkboxes" scope="page" value="true"/>
  <html:form action="/users/deleteUsers">
    <%@ include file="../buttons.jsp" %>
    <br>
    <html:hidden property="databaseName"/>
    <%@ include file="users.jspf" %>
    <%@ include file="../buttons.jsp" %>
  </html:form>
  <br>
  
  <%@ include file="footer.jsp" %>
  
  </body>
  </html:html>
  
  
  
  1.1                  jakarta-tomcat-4.0/webapps/admin/users/groups.jspf
  
  Index: groups.jspf
  ===================================================================
  <%-- Groups List --%>
  
  <table class="back-table" border="0" cellspacing="0" cellpadding="1"
         width="100%"><tr><td> 
  
    <table class="front-table" border="1"
     cellspacing="0" cellpadding="0" width="100%">
      <tr class="header-row">
        <logic:present name="checkboxes">
          <td width="5%"><div align="left" class="table-header-text">
            &nbsp;
          </td>
        </logic:present>
        <td><div align="left" class="table-header-text">
          <bean:message key="users.list.groupname"/>
        </div></td>
        <td><div align="left" class="table-header-text">
          <bean:message key="users.list.description"/>
        </div></td>
      </tr>
      <logic:iterate name="groupsForm" property="groups"
                       id="group" type="java.lang.String">
        <tr class="line-row">
          <logic:present name="checkboxes">
            <td><div align="center" class="table-normal-text">
              <input type="checkbox" name="groups"
                    value="<%= group %>">
            </td>
          </logic:present>
          <td><div align="left" class="table-normal-text">&nbsp;
            <html:link page='<%= "/users/setUpGroup.do?objectName=" + 
                                 URLEncoder.encode(group) %>'>
              <controls:attribute name="group" attribute="groupname"/>
            </html:link>
          </div></td>
          <td><div align="left" class="table-normal-text">&nbsp;
            <controls:attribute name="group" attribute="description"/>
          </div></td>
        </tr>
      </logic:iterate>
    </table>
  
  </td></tr></table>
  
  
  
  1.1                  jakarta-tomcat-4.0/webapps/admin/users/listGroups.jspf
  
  Index: listGroups.jspf
  ===================================================================
  <controls:actions>
  
    <controls:action selected="true">
      ----<bean:message key="actions.available.actions"/>----
    </controls:action>
  
    <controls:action>
      ---------------------------------
    </controls:action>
  
    <controls:action url='<%= "/users/setUpGroup.do?databaseName=" +
         URLEncoder.encode(request.getParameter("databaseName")) %>'>
      <bean:message key="users.actions.group.create"/>
    </controls:action>
  
    <controls:action url='<%= "/users/listGroups.do?databaseName=" +
         URLEncoder.encode(request.getParameter("databaseName")) +
         "&forward=" + URLEncoder.encode("Groups Delete List") %>'>
      <bean:message key="users.actions.group.delete"/>
    </controls:action>
  
    <controls:action url='<%= "/users/listGroups.do?databaseName=" +
         URLEncoder.encode(request.getParameter("databaseName")) +
         "&forward=" + URLEncoder.encode("Groups List") %>'>
      <bean:message key="users.actions.group.list"/>
    </controls:action>
  
  </controls:actions>
  
  
  
  1.1                  jakarta-tomcat-4.0/webapps/admin/users/listRoles.jspf
  
  Index: listRoles.jspf
  ===================================================================
  <controls:actions>
  
    <controls:action selected="true">
      ----<bean:message key="actions.available.actions"/>----
    </controls:action>
  
    <controls:action>
      ---------------------------------
    </controls:action>
  
    <controls:action url='<%= "/users/setUpRole.do?databaseName=" +
         URLEncoder.encode(request.getParameter("databaseName")) %>'>
      <bean:message key="users.actions.role.create"/>
    </controls:action>
  
    <controls:action url='<%= "/users/listRoles.do?databaseName=" +
         URLEncoder.encode(request.getParameter("databaseName")) +
         "&forward=" + URLEncoder.encode("Roles Delete List") %>'>
      <bean:message key="users.actions.role.delete"/>
    </controls:action>
  
    <controls:action url='<%= "/users/listRoles.do?databaseName=" +
         URLEncoder.encode(request.getParameter("databaseName")) +
         "&forward=" + URLEncoder.encode("Roles List") %>'>
      <bean:message key="users.actions.role.list"/>
    </controls:action>
  
  </controls:actions>
  
  
  
  1.1                  jakarta-tomcat-4.0/webapps/admin/users/listUsers.jspf
  
  Index: listUsers.jspf
  ===================================================================
  <controls:actions>
  
    <controls:action selected="true">
      ----<bean:message key="actions.available.actions"/>----
    </controls:action>
  
    <controls:action>
      ---------------------------------
    </controls:action>
  
    <controls:action url='<%= "/users/setUpUser.do?databaseName=" +
         URLEncoder.encode(request.getParameter("databaseName")) %>'>
      <bean:message key="users.actions.user.create"/>
    </controls:action>
  
    <controls:action url='<%= "/users/listUsers.do?databaseName=" +
         URLEncoder.encode(request.getParameter("databaseName")) +
         "&forward=" + URLEncoder.encode("Users Delete List") %>'>
      <bean:message key="users.actions.user.delete"/>
    </controls:action>
  
    <controls:action url='<%= "/users/listUsers.do?databaseName=" +
         URLEncoder.encode(request.getParameter("databaseName")) +
         "&forward=" + URLEncoder.encode("Users List") %>'>
      <bean:message key="users.actions.user.list"/>
    </controls:action>
  
  </controls:actions>
  
  
  
  1.1                  jakarta-tomcat-4.0/webapps/admin/users/users.jspf
  
  Index: users.jspf
  ===================================================================
  <%-- Users List --%>
  
  <table class="back-table" border="0" cellspacing="0" cellpadding="1"
         width="100%"><tr><td> 
  
    <table class="front-table" border="1"
     cellspacing="0" cellpadding="0" width="100%">
      <tr class="header-row">
        <logic:present name="checkboxes">
          <td width="5%"><div align="left" class="table-header-text">
            &nbsp;
          </td>
        </logic:present>
        <td><div align="left" class="table-header-text">
          <bean:message key="users.list.username"/>
        </div></td>
        <td><div align="left" class="table-header-text">
          <bean:message key="users.list.fullName"/>
        </div></td>
      </tr>
      <logic:iterate name="usersForm" property="users"
                       id="user" type="java.lang.String">
        <tr class="line-row">
          <logic:present name="checkboxes">
            <td><div align="center" class="table-normal-text">
              <input type="checkbox" name="users"
                    value="<%= user %>">
            </td>
          </logic:present>
          <td><div align="left" class="table-normal-text">&nbsp;
            <html:link page='<%= "/users/setUpUser.do?objectName=" + 
                                 URLEncoder.encode(user) %>'>
              <controls:attribute name="user" attribute="username"/>
            </html:link>
          </div></td>
          <td><div align="left" class="table-normal-text">&nbsp;
            <controls:attribute name="user" attribute="fullName"/>
          </div></td>
        </tr>
      </logic:iterate>
    </table>
  
  </td></tr></table>
  
  
  

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