turned @AllowedMethods into String[]

This commit is contained in:
cnenning
2016-01-29 15:53:18 +01:00
parent d0baa7060d
commit cceb891667
3 changed files with 7 additions and 3 deletions
@@ -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;
}
}
@@ -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;
}
@@ -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;