Author: pbenedict
Date: Fri Nov 17 22:39:29 2006
New Revision: 476456

URL: http://svn.apache.org/viewvc?view=rev&rev=476456
Log:
STR-2864: Disallow forward slashes in actionId

Modified:
    
struts/struts1/trunk/core/src/main/java/org/apache/struts/config/ActionConfig.java

Modified: 
struts/struts1/trunk/core/src/main/java/org/apache/struts/config/ActionConfig.java
URL: 
http://svn.apache.org/viewvc/struts/struts1/trunk/core/src/main/java/org/apache/struts/config/ActionConfig.java?view=diff&rev=476456&r1=476455&r2=476456
==============================================================================
--- 
struts/struts1/trunk/core/src/main/java/org/apache/struts/config/ActionConfig.java
 (original)
+++ 
struts/struts1/trunk/core/src/main/java/org/apache/struts/config/ActionConfig.java
 Fri Nov 17 22:39:29 2006
@@ -235,14 +235,20 @@
 
     /**
      * <p>The internal name of this action mapping. The name is not 
inheritable,
-     * and must be unique within a module. </p>
+     * may not contain a forward slash, and must be unique within a module. 
</p>
      *
      * @param actionId the action identifier
      * @since Struts 1.3.6
+     * @throws IllegalStateException if the configuration is frozen
+     * @throws IllegalArgumentException if the identifier contains a forward 
slash
      */
     public void setActionId(String actionId) {
         if (configured) {
             throw new IllegalStateException("Configuration is frozen");
+        }
+        
+        if ((actionId != null) && (actionId.indexOf("/") > -1)) {
+            throw new IllegalArgumentException("actionId '" + actionId + "' 
may not contain a forward slash");
         }
 
         this.actionId = actionId;


Reply via email to