javax.servlet.jsp.el.ELException: Unable to find a value for "name" in object of class "java.lang.String" using operator "."

This is piece of jstl problem that is difficult to identify.

A. When using <c:forEach> tag you sometimes get a error message like this:

javax.servlet.jsp.el.ELException: Unable to find a value for "name" in object of class "java.lang.String" using operator "."

Before knocking your head on the wall, check if there is trailing space(s) in the attribute like this one: 

items="${orderList}_" (I mark it as underscore so you easily see it.)

And that's the problem!

B. Suppose you have an inner class with default package access. Now you have a model attribute in your controller, which is having member of this inner class type, and in the jsp you find you can not refer to it using . operator with expression language.
In such case you must declare the inner class as public. That's because even in your controller you can access the inner class, but the bean is not in "same package" when you access with jstl.


评论

此博客中的热门博文

Nu förbjuder Kina handel med elfenben

Fader av pingyins

Kineserna vill köpa Volvos kompetens