mirror of
https://github.com/apache/struts.git
synced 2026-08-11 01:27:14 +00:00
turned @AllowedMethods into String[]
This commit is contained in:
+5
-1
@@ -744,7 +744,11 @@ public class PackageBasedActionConfigBuilder implements ActionConfigBuilder {
|
||||
if (annotation == null) {
|
||||
return Collections.emptySet();
|
||||
} else {
|
||||
return TextParseUtil.commaDelimitedStringToSet(annotation.value());
|
||||
Set<String> methods = new HashSet<>();
|
||||
for (String method : annotation.value()) {
|
||||
methods.add(method);
|
||||
}
|
||||
return methods;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -25,6 +25,6 @@ import java.lang.annotation.Target;
|
||||
@Retention(value = RetentionPolicy.RUNTIME)
|
||||
public @interface AllowedMethods {
|
||||
|
||||
String value() default ActionConfig.DEFAULT_METHOD;
|
||||
String[] value() default ActionConfig.DEFAULT_METHOD;
|
||||
|
||||
}
|
||||
|
||||
+1
-1
@@ -18,6 +18,6 @@
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
@org.apache.struts2.convention.annotation.AllowedMethods("home,start")
|
||||
@org.apache.struts2.convention.annotation.AllowedMethods({"home", "start"})
|
||||
package org.apache.struts2.convention.actions.allowedmethods;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user