jmitchell    2003/12/22 11:42:32

  Modified:    src/share/org/apache/struts/actions DispatchAction.java
                        LocalStrings.properties
  Log:
  Fix for potential recursive call with DispatchAction
  
  Revision  Changes    Path
  1.22      +17 -4     
jakarta-struts/src/share/org/apache/struts/actions/DispatchAction.java
  
  Index: DispatchAction.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-struts/src/share/org/apache/struts/actions/DispatchAction.java,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- DispatchAction.java       5 Oct 2003 17:48:57 -0000       1.21
  +++ DispatchAction.java       22 Dec 2003 19:42:32 -0000      1.22
  @@ -224,6 +224,17 @@
               throw new ServletException(message);
           }
   
  +             // Prevent recursive calls
  +             if (parameter.equals("execute") || parameter.equals("perform")){
  +                     String message =
  +                             messages.getMessage("dispatch.recursive", 
mapping.getPath());
  +
  +                     log.error(message);
  +
  +                     throw new ServletException(message);
  +
  +             }
  +
           // Get the method's name. This could be overridden in subclasses.
           String name = getMethodName(mapping, form, request, response, parameter);
   
  @@ -233,6 +244,8 @@
       }
   
   
  +
  +    
       /**
        * Method which is dispatched to when there is no value for specified
        * request parameter included in the request.  Subclasses of
  
  
  
  1.10      +2 -1      
jakarta-struts/src/share/org/apache/struts/actions/LocalStrings.properties
  
  Index: LocalStrings.properties
  ===================================================================
  RCS file: 
/home/cvs/jakarta-struts/src/share/org/apache/struts/actions/LocalStrings.properties,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- LocalStrings.properties   13 Aug 2003 17:19:58 -0000      1.9
  +++ LocalStrings.properties   22 Dec 2003 19:42:32 -0000      1.10
  @@ -1,5 +1,6 @@
   dispatch.error=Dispatch[{0}] to method '{1}' returned an exception
   dispatch.handler=DispatchMapping[{0}] does not define a handler property
  +dispatch.recursive=Do not use 'execute' or 'perform' with DispatchAction.
   dispatch.lookup=Action[{0}] does not contain handler for resource '{1}'
   dispatch.mapping=ActionMapping[{0}] is not of type DispatchMapping
   dispatch.method=Action[{0}] does not contain method named '{1}'
  @@ -13,4 +14,4 @@
   switch.prefix=Invalid module prefix '{0}' was specified
   switch.required=Switch requires both 'prefix' and 'page' request parameters
   success.required=SuccessAction could not find an ActionForward named 'success' for 
path '{0}'
  -mapping.parameter=ActionMapping[{0}] does not define a 'parameter' attribute
  \ No newline at end of file
  +mapping.parameter=ActionMapping[{0}] does not define a 'parameter' attribute
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to