我创建了一种方法
@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
在我的UserSetting
pojo 类中,我正在检查非空键。如何解决这个问题?
我只能使用@PathVariable
,我不能使用@RequestParam
所以请帮助我