@Ok("raw:jpg")
@At("/avatar")
@GET
public Object readAvatar(@Attr(scope=Scope.SESSION, value="me")int userId, HttpServletRequest req) throws SQLException {
UserProfile profile = Daos.ext(dao, FieldFilter.create(UserProfile.class, "^avatar$")).fetch(UserProfile.class, userId);
if (profile == null || profile.getAvatar() == null) {
return new File(req.getServletContext().getRealPath("/image/user_avatar/none.jpg"));
}
return profile.getAvatar();
}
问答
在操作用户头像上传及显示时,报demo.hello.bean.User cannot be cast to java.lang.Integer,想请教大神是什么原因,感谢!
标签:
无
添加回复
请先登陆