struts2 依赖注入boolean类型的属性时报错
?
对应的bean中有一个成员变量是:private boolean isBoy;(是boolean 类型的)
?
?
?但是登录时报错:
?
package com.jn.bean;public class LoginUser {private int age;private String username;private String password;/*** * 是否是男性 */private boolean boy;public LoginUser() {super();}public int getAge() {return age;}public void setAge(int age) {this.age = age;}public String getUsername() {return username;}public void setUsername(String username) {this.username = username;}public String getPassword() {return password;}public void setPassword(String password) {this.password = password;}public boolean isBoy() {return boy;}public void setBoy(boolean boy) {this.boy = boy;}}?登录页面中把user.isBoy 改为user.boy 就好了。
?
?