You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by dg...@apache.org on 2003/07/02 04:30:28 UTC

cvs commit: jakarta-struts/src/share/org/apache/struts/action RequestProcessor.java

dgraham     2003/07/01 19:30:28

  Modified:    src/share/org/apache/struts/action RequestProcessor.java
  Log:
  Changed processRoles() to send a 403 Forbidden response if the role check
  fails for PR# 17276.  Also removed deprecated methods.
  
  Revision  Changes    Path
  1.31      +10 -58    jakarta-struts/src/share/org/apache/struts/action/RequestProcessor.java
  
  Index: RequestProcessor.java
  ===================================================================
  RCS file: /home/cvs/jakarta-struts/src/share/org/apache/struts/action/RequestProcessor.java,v
  retrieving revision 1.30
  retrieving revision 1.31
  diff -u -r1.30 -r1.31
  --- RequestProcessor.java	19 Apr 2003 01:16:29 -0000	1.30
  +++ RequestProcessor.java	2 Jul 2003 02:30:28 -0000	1.31
  @@ -59,10 +59,8 @@
    *
    */
   
  -
   package org.apache.struts.action;
   
  -
   import java.io.IOException;
   import java.util.HashMap;
   import java.util.Iterator;
  @@ -87,7 +85,6 @@
   import org.apache.struts.util.MessageResources;
   import org.apache.struts.util.RequestUtils;
   
  -
   /**
    * <p><strong>RequestProcessor</strong> contains the processing logic that
    * the Struts controller servlet performs as it receives each servlet request
  @@ -100,7 +97,6 @@
    * @version $Revision$ $Date$
    * @since Struts 1.1
    */
  -
   public class RequestProcessor {
   
   
  @@ -132,13 +128,6 @@
        */
       protected HashMap actions = new HashMap();
   
  -
  -    /**
  -     * The ModuleConfiguration we are associated with.
  -     * @deprecated use moduleConfig instead.
  -     */
  -    protected ModuleConfig appConfig = null;
  -
       /**
        * The ModuleConfiguration we are associated with.
        */
  @@ -192,8 +181,8 @@
           synchronized (actions) {
               actions.clear();
           }
  +        
           this.servlet = servlet;
  -        this.appConfig = moduleConfig;
           this.moduleConfig = moduleConfig;
   
       }
  @@ -384,31 +373,6 @@
       }
   
   
  -
  -    /**
  -     * Forward or redirect to the specified destination, by the specified
  -     * mechanism.
  -     *
  -     * This method takes the old ActionForward object as parameter. User should
  -     * use {@link #processForwardConfig(HttpServletRequest, HttpServletResponse,ForwardConfig)} when possible.
  -     * @param request The servlet request we are processing
  -     * @param response The servlet response we are creating
  -     * @param forward The ActionForward controlling where we go next
  -     *
  -     * @exception IOException if an input/output error occurs
  -     * @exception ServletException if a servlet exception occurs
  -     * @deprecated Use processForwardConfig() instead.
  -     */
  -    protected void processActionForward(HttpServletRequest request,
  -                                        HttpServletResponse response,
  -                                        ActionForward forward)
  -        throws IOException, ServletException {
  -
  -        processForwardConfig( request, response, forward );
  -
  -    }
  -
  -
       /**
        * Forward or redirect to the specified destination, by the specified
        * mechanism.  This method uses a ForwardConfig object instead an ActionForward.
  @@ -887,9 +851,11 @@
               log.debug(" User '" + request.getRemoteUser() +
                         "' does not have any required role, denying access");
           }
  -        response.sendError(HttpServletResponse.SC_BAD_REQUEST,
  -                           getInternal().getMessage("notAuthorized",
  -                                                    mapping.getPath()));
  +        
  +        response.sendError(
  +            HttpServletResponse.SC_FORBIDDEN,
  +            getInternal().getMessage("notAuthorized", mapping.getPath()));
  +                                                    
           return (false);
   
       }
  @@ -1101,20 +1067,6 @@
   
   
       // -------------------------------------------------------- Support Methods
  -
  -
  -    /**
  -     * Return the debugging detail level that has been configured for our
  -     * controller servlet.
  -     *
  -     * @deprecated Configure the logging detail level in your
  -     *  underlying logging implementation
  -     */
  -    public int getDebug() {
  -
  -        return (servlet.getDebug());
  -
  -    }
   
   
       /**
  
  
  

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