tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject cvs commit: jakarta-tomcat-catalina/webapps/admin/context context.jsp
Date Fri, 14 Jan 2005 23:55:41 GMT
markt       2005/01/14 15:55:41

  Modified:    webapps/admin/WEB-INF/classes/org/apache/webapp/admin
                        ApplicationResources.properties
               webapps/admin/WEB-INF/classes/org/apache/webapp/admin/context
                        AddContextAction.java ContextForm.java
                        DeleteContextAction.java DeleteContextsAction.java
                        EditContextAction.java SaveContextAction.java
               webapps/admin/context context.jsp
  Log:
  Fix bug 33085. Expose privileged attribute of context through admin webapp.
  Also, remove unused imports in o.a.c.webapp.admin.context package
   - Ported from TC4.
  
  Revision  Changes    Path
  1.6       +1 -0      jakarta-tomcat-catalina/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/ApplicationResources.properties
  
  Index: ApplicationResources.properties
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-catalina/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/ApplicationResources.properties,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- ApplicationResources.properties	29 Jul 2004 06:31:59 -0000	1.5
  +++ ApplicationResources.properties	14 Jan 2005 23:55:41 -0000	1.6
  @@ -165,6 +165,7 @@
   context.cross.context=Cross Context
   context.docBase=Document Base
   context.override=Override
  +context.privileged=Privileged
   context.path=Path
   context.reloadable=Reloadable
   context.swallowOutput=Swallow Output
  
  
  
  1.9       +2 -4      jakarta-tomcat-catalina/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/context/AddContextAction.java
  
  Index: AddContextAction.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-catalina/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/context/AddContextAction.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- AddContextAction.java	18 Oct 2004 06:37:53 -0000	1.8
  +++ AddContextAction.java	14 Jan 2005 23:55:41 -0000	1.9
  @@ -18,18 +18,15 @@
   
   import java.io.IOException;
   import java.util.Locale;
  -import java.util.ArrayList;
   import javax.servlet.ServletException;
   import javax.servlet.http.HttpServletRequest;
   import javax.servlet.http.HttpServletResponse;
   import javax.servlet.http.HttpSession;
   import org.apache.struts.action.Action;
  -import org.apache.struts.action.ActionErrors;
   import org.apache.struts.action.ActionForm;
   import org.apache.struts.action.ActionForward;
   import org.apache.struts.action.ActionMapping;
   import org.apache.struts.util.MessageResources;
  -import org.apache.webapp.admin.LabelValueBean;
   import org.apache.webapp.admin.Lists;
   import org.apache.webapp.admin.TomcatTreeBuilder;
   /**
  @@ -90,6 +87,7 @@
           contextFm.setCrossContext("false");
           contextFm.setDocBase("");
           contextFm.setOverride("false");
  +        contextFm.setPrivileged("false");
           contextFm.setPath("");
           contextFm.setReloadable("false");
           contextFm.setSwallowOutput("false");
  
  
  
  1.8       +26 -2     jakarta-tomcat-catalina/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/context/ContextForm.java
  
  Index: ContextForm.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-catalina/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/context/ContextForm.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- ContextForm.java	29 Jul 2004 06:31:59 -0000	1.7
  +++ ContextForm.java	14 Jan 2005 23:55:41 -0000	1.8
  @@ -22,7 +22,6 @@
   import org.apache.struts.action.ActionErrors;
   import org.apache.struts.action.ActionForm;
   import org.apache.struts.action.ActionMapping;
  -import java.net.InetAddress;
   import java.util.List;
   
   /**
  @@ -87,6 +86,11 @@
       private String override = "false";
       
       /**
  +     * The text for privileged boolean.
  +     */
  +    private String privileged = "false";
  +    
  +    /**
        * The text for the context path for this context.
        */
       private String path = null;
  @@ -358,6 +362,26 @@
       public void setOverride(String override) {
           
           this.override = override;
  +        
  +    }
  +    
  +    
  +    /**
  +     * Return the privileged boolean value.
  +     */
  +    
  +    public String getPrivileged() {
  +        
  +        return this.privileged;
  +        
  +    }
  +    
  +    /**
  +     * Set the privileged value.
  +     */
  +    public void setPrivileged(String privileged) {
  +        
  +        this.privileged = privileged;
           
       }
       
  
  
  
  1.7       +1 -11     jakarta-tomcat-catalina/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/context/DeleteContextAction.java
  
  Index: DeleteContextAction.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-catalina/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/context/DeleteContextAction.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- DeleteContextAction.java	18 Oct 2004 06:37:53 -0000	1.6
  +++ DeleteContextAction.java	14 Jan 2005 23:55:41 -0000	1.7
  @@ -20,32 +20,22 @@
   import java.io.IOException;
   import java.util.Collections;
   import java.util.Iterator;
  -import java.util.List;
   import java.util.Locale;
  -import java.util.TreeSet;
  -import java.util.Set;
   import java.util.ArrayList;
   import javax.servlet.ServletException;
   import javax.servlet.http.HttpServletRequest;
   import javax.servlet.http.HttpServletResponse;
   import javax.servlet.http.HttpSession;
   import org.apache.struts.action.Action;
  -import org.apache.struts.action.ActionErrors;
   import org.apache.struts.action.ActionForm;
   import org.apache.struts.action.ActionForward;
   import org.apache.struts.action.ActionMapping;
   
   import javax.management.MBeanServer;
  -import javax.management.MBeanServerFactory;
  -import javax.management.QueryExp;
  -import javax.management.Query;
  -import javax.management.ObjectInstance;
   import javax.management.ObjectName;
  -import javax.management.JMException;
   import org.apache.struts.util.MessageResources;
   
   import org.apache.webapp.admin.ApplicationServlet;
  -import org.apache.webapp.admin.TomcatTreeBuilder;
   
   /**
    * The <code>Action</code> that sets up <em>Delete Contexts</em>
transactions.
  
  
  
  1.7       +1 -7      jakarta-tomcat-catalina/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/context/DeleteContextsAction.java
  
  Index: DeleteContextsAction.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-catalina/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/context/DeleteContextsAction.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- DeleteContextsAction.java	18 Oct 2004 06:37:53 -0000	1.6
  +++ DeleteContextsAction.java	14 Jan 2005 23:55:41 -0000	1.7
  @@ -18,15 +18,9 @@
   package org.apache.webapp.admin.context;
   
   import java.io.IOException;
  -import java.util.ArrayList;
  -import java.util.Iterator;
   import java.util.Locale;
  -import java.util.Set;
  -import java.util.TreeSet;
   import javax.management.MBeanServer;
   import javax.management.ObjectName;
  -import javax.management.ObjectInstance;
  -import javax.management.modelmbean.ModelMBean;
   import javax.servlet.ServletException;
   import javax.servlet.http.HttpSession;
   import javax.servlet.http.HttpServletRequest;
  
  
  
  1.12      +4 -9      jakarta-tomcat-catalina/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/context/EditContextAction.java
  
  Index: EditContextAction.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-catalina/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/context/EditContextAction.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- EditContextAction.java	18 Oct 2004 06:37:53 -0000	1.11
  +++ EditContextAction.java	14 Jan 2005 23:55:41 -0000	1.12
  @@ -17,30 +17,22 @@
   package org.apache.webapp.admin.context;
   
   import java.io.IOException;
  -import java.util.Iterator;
  -import java.util.List;
   import java.util.Locale;
  -import java.util.ArrayList;
   import javax.servlet.ServletException;
   import javax.servlet.http.HttpServletRequest;
   import javax.servlet.http.HttpServletResponse;
   import javax.servlet.http.HttpSession;
   import org.apache.struts.action.Action;
  -import org.apache.struts.action.ActionErrors;
   import org.apache.struts.action.ActionForm;
   import org.apache.struts.action.ActionForward;
   import org.apache.struts.action.ActionMapping;
   import org.apache.struts.util.MessageResources;
   
   import javax.management.MBeanServer;
  -import javax.management.ObjectInstance;
   import javax.management.ObjectName;
  -import javax.management.JMException;
   
   import org.apache.webapp.admin.ApplicationServlet;
  -import org.apache.webapp.admin.LabelValueBean;
   import org.apache.webapp.admin.Lists;
  -import org.apache.webapp.admin.TomcatTreeBuilder;
   
   /**
    * The <code>Action</code> that sets up <em>Edit Context</em> transactions.
  @@ -196,6 +188,9 @@
                   (((Boolean) mBServer.getAttribute(cname, attribute)).toString());
               attribute = "override";
               contextFm.setOverride
  +                (((Boolean) mBServer.getAttribute(cname, attribute)).toString());
  +            attribute = "privileged";
  +            contextFm.setPrivileged
                   (((Boolean) mBServer.getAttribute(cname, attribute)).toString());
   
   	    attribute = "antiJARLocking";
  
  
  
  1.18      +11 -7     jakarta-tomcat-catalina/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/context/SaveContextAction.java
  
  Index: SaveContextAction.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-catalina/webapps/admin/WEB-INF/classes/org/apache/webapp/admin/context/SaveContextAction.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- SaveContextAction.java	18 Oct 2004 06:37:53 -0000	1.17
  +++ SaveContextAction.java	14 Jan 2005 23:55:41 -0000	1.18
  @@ -18,17 +18,11 @@
   
   
   import java.net.URLEncoder;
  -import java.util.Iterator;
   import java.util.Locale;
   import java.io.IOException;
   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.servlet.ServletException;
   import javax.servlet.http.HttpServletRequest;
   import javax.servlet.http.HttpServletResponse;
  @@ -291,6 +285,16 @@
               }
               mBServer.setAttribute(coname,
                                     new Attribute("override", new Boolean(override)));
  +
  +            attribute = "privileged";
  +            String privileged = "false";
  +            try {
  +                privileged = cform.getPrivileged();
  +            } catch (Throwable t) {
  +                privileged = "false";
  +            }
  +            mBServer.setAttribute(coname,
  +                                  new Attribute("privileged", new Boolean(privileged)));
   
               attribute = "reloadable";
               String reloadable = "false";
  
  
  
  1.9       +11 -0     jakarta-tomcat-catalina/webapps/admin/context/context.jsp
  
  Index: context.jsp
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-catalina/webapps/admin/context/context.jsp,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- context.jsp	18 Oct 2004 06:37:55 -0000	1.8
  +++ context.jsp	14 Jan 2005 23:55:41 -0000	1.9
  @@ -147,6 +147,17 @@
               </controls:data>
           </controls:row>
   
  +      <controls:row labelStyle="table-label-text" dataStyle="table-normal-text" styleId="privileged">
  +            <controls:label><bean:message key="context.privileged"/>:</controls:label>
  +            <controls:data>
  +                <html:select property="privileged" styleId="privileged">
  +                     <bean:define id="booleanVals" name="contextForm" property="booleanVals"/>
  +                     <html:options collection="booleanVals" property="value"
  +                   labelProperty="label"/>
  +                </html:select>
  +            </controls:data>
  +        </controls:row>
  +
   <%-- input only allowed on create transaction --%>
          <controls:row labelStyle="table-label-text" dataStyle="table-normal-text" styleId="path">
               <controls:label><bean:message key="context.path"/>:</controls:label>
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Mime
View raw message