欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

struts2知识

程序员文章站 2022-03-30 13:22:39
...
1、如果使用属性驱动中的private User user; 那么表单的name要改成 user.xxx
如果用模型驱动的话 要把对象new出来private User user = new User();
2、注入service后还需要privet和setservice名
    private LoginLogService loginLogService;
    public void setLoginLogService(LoginLogService loginLogService) {
        this.loginLogService = loginLogService;
    }
如果没有会org.springframework.beans.NotWritablePropertyException: Invalid property 'loginLogService' of bean class [my.action.LoginAction]: Bean 
property 'loginLogService' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?