The exception is basicaly telling you that ${user}
is an ordinary java.lang.String
. According to the javadoc, it has indeed no getUserid()
method representing an userid
property.
Make sure that you're setting a concrete User
instance in the desired scope instead of a plain vanilla String
. As you haven't shown anywhere in the question how you're preparing the scoped variable, it isn't possible to give a targeted answer on that, but it should at least look something like this:
User user = userService.find(id);
request.setAttribute("user", user); // and thus not e.g. setAttribute("user", "user") or something.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…