Reading the @RequestMapping documentation : http://static.springsource.org/spring/docs/2.5.x/api/org/springframework/web/bind/annotation/RequestMapping.html
It accepts a String array parameter for its path mapping.
So this works using java :
@RequestMapping("MYVIEW")
but in scala I need to use :
@RequestMapping(Array("MYVIEW"))
The scala version makes sense as the annotation expects a String array. But why does above work in java, should it not give a compile time error ?
Below class 'ArrayChecker' (a class I wrote to illustrate this point) causes a java compile time error :
The method acceptArrayParam(String[]) in the type ArrayChecker is not applicable for the arguments (String)
public class ArrayChecker {
public static void main(String args[]){
String[] strArray;
acceptArrayParam("test");
}
private static void acceptArrayParam(String[] param){
}
}
Should a similar error not be caused by @RequestMapping("MYVIEW") ?