在第二个请求中自动装配null

时间:2015-12-04 09:32:35

标签: java spring web-services

我已经注释了我的spring类,但是每当我第二次触发webservice时,我都会得到null异常。它第一次工作正常。

我已经自动安装了dao课程。

@Component
public class JdbcUserDAO implements UserDAO {

@Component
@XmlRootElement(name = "user")
public class User {
    private static final Logger log = LoggerFactory.getLogger(User.class);
    //private JdbcUserDAO jdbcUserDao = new JdbcUserDAO();
    @Autowired
    JdbcUserDAO jdbcUserDao;

    @RequestMapping(value = "/editprofile", method = RequestMethod.POST,consumes = "application/json", produces = "application/json")
    public Response<User> editProfile(@RequestBody User userIn) {       
        Response<User> response = new Response<User>();
        user =  user.edit(userIn);

0 个答案:

没有答案