OK, this fails:
public class MyLoginBean extends org.apache.struts.action.ActionForm {
private String[] roles;
public MyLoginBean() {
this.roles = {"User"};
}
}
This works:
public class MyLoginBean extends org.apache.struts.action.ActionForm {
private String[] roles;
public MyLoginBean() {
String[] blah = {"User"};
}
}
Any information would be appreciated.
Thanks.
Try
the array initializer of type
String[] foo = {"bar1", "bar2"};can be used if only you have the declaration and initialization together. If you seperate the initialization from declaration, you cannot do{...}; you’ll have tonew String[]{...}