0

我创建了一种方法

@RequestMapping(value = "/settings/userSettings/{key}", method = RequestMethod.POST)
@Secured("ROLE_HOME_TAB")
public ModelAndView updateUserSetting(HttpServletRequest request,
        @PathVariable("key") String key,
        @RequestParam(defaultValue = "") String value) {
    Map<Object, Object> model = new HashMap<Object, Object>();

        try {
            User user = RequestUtils.getUser(request);
            UserSettings userSettings = userManager.getUserSettings(user,
                    key);
            if (userSettings == null) {
                userSettings = new UserSettings(user, key);
            }
            userSettings.setValue(value);
            userManager.saveObject(userSettings);
        } catch (Exception e) {
            log.error("", e);
        }

    return new ModelAndView(new JSONView(
            model));
}

但是当我启动服务器时,我收到了这个错误

Superclass has no null constructors but no arguments were given

Could not generate CGLIB subclass of class 

在我的UserSettingpojo 类中,我正在检查非空键。如何解决这个问题?

我只能使用@PathVariable,我不能使用@RequestParam所以请帮助我

4

1 回答 1

0

请尝试:您要使用 CGLib 代理的类必须提供默认构造函数。

来源: http: //forum.springsource.org/showthread.php?50210-Superclass-has-no-null-constructors-but-no-arguments-were-given

于 2012-11-22T05:52:23.540 回答