getBean中的的String[]属性,不能自动转换

<input type="checkbox" data-type="param" name="menuSetting.roles"  value="#(role.id)"/> #(role.name)

javabean

public class MenuSetting {

    String[] roles

    get;set;

}

getBean(MenuSetting.class)报错

评论区

JFinal

2021-01-06 14:05

啥错?

graphics

2021-01-06 15:12

java.lang.RuntimeException: Please add code in class com.jfinal.core.converter.TypeConverter. The type can't be converted: [Ljava.lang.String;

graphics

2021-01-06 15:12

at com.jfinal.core.converter.TypeConverter.convert(TypeConverter.java:129)

graphics

2021-01-06 15:13

private String[] roles;
public void setRoles(String[] roles) {
this.roles = roles;
}
public String[] getRoles() {
return roles;
}

graphics

2021-01-06 15:16

没有数组TypeConverter

热门反馈

扫码入社