ERROR :
Class org.apache.struts2.json.JSONWriter can not access a member of class org.springframework.aop.TruePointcut with modifiers
"public"
参考:http://home.51.com/qq453200576/diary/item/10057409.html
其实就是
public class UserResiterAction extends ActionSupport { public String msg; public boolean success; private String name; private String password; private String stuid; private String tel; private String sex; private String qq; private String email; private String grade_class; private String birthday; // UserManager um = new UserManagerImpl();\ private UserManager um ; public UserResiterAction() { ApplicationContext ctx = new ClassPathXmlApplicationContext("beans.xml"); um = (UserManager)ctx.getBean("userManager"); } @Resource(name="userManager") public void setUm(UserManager um) { this.um = um; } public String execute() throws Exception { // System.out.println(username); System.out.println(name); System.out.println(password); System.out.println(stuid); System.out.println(tel); System.out.println(sex); System.out.println(qq); System.out.println(email); System.out.println(grade_class); System.out.println(birthday); char[] c = birthday.toCharArray(); for (int i = 0;i < c.length;i ++) { System.out.println(c[i]); } ConvertUtil cu =new ConvertUtil(); User u = new User(); u.setName(name); u.setPassword(cu.MD5(password)); u.setScore(0); u.setStuid(stuid); u.setTel(tel); u.setSex(sex); u.setQq(qq); u.setEmail(email); u.setGrade_class(grade_class); String birthday2=cu.getTime2(birthday); System.out.println("new date="+birthday2); u.setBirthday(birthday2); u.setDirection("NO"); u.setIntro("Empty"); // if(um.exists(u)) { // this.msg="注册失败存在用户"; // return "fail"; // } // um.add(u); this.msg="注册成功"; return SUCCESS; } // public String getName() { // return name; // } public void setName(String name) { this.name = name; } // public String getPassword() { // return password; // } public void setPassword(String password) { this.password = password; } // public String getStuid() { // return stuid; // } public void setStuid(String stuid) { this.stuid = stuid; } // public String getTel() { // return tel; // } public void setTel(String tel) { this.tel = tel; } // public String getSex() { // return sex; // } public void setSex(String sex) { this.sex = sex; } // // public String getQq() { // return qq; // } public void setQq(String qq) { this.qq = qq; } // // public String getEmail() { // return email; // } public void setEmail(String email) { this.email = email; } // public String getGrade_class() { // return grade_class; // } public void setGrade_class(String grade_class) { this.grade_class = grade_class; } // public String getBirthday() { // return birthday; // } public void setBirthday(String birthday) { this.birthday = birthday; } public void setMsg(String msg) { this.msg = msg; } public void setSuccess(boolean success) { this.success = success; } }
把getUm去掉就行了,,其他get*注释掉是解决的时候尝试的 发现去了不影响 因为得到值是由 set方法
为什么getUm去掉,也就是一般的 get*Service去掉 ?我也不懂。。。
版权声明:本文为博主原创文章,未经博主允许不得转载。
today lazy . tomorrow die .