我正在JSP中创建一个简单的留言簿以学习此技术。目前我有两个类:留言簿/ GuestBook.class和留言簿/ Entry.class(我还没有完成应用程序,所以我只有这些类),它们被添加到WEB-INF/libs /中,并且它们被正确包含。在我的文件index.jsp中,我使用了guestbook.GuestBook类;其方法返回Vector。当我遍历条目,我想打印的条目的作者,我可以看到:未找到JSP,EL属性
javax.el.PropertyNotFoundException: Property 'author' not found on type guestbook.Entry
我必须补充的是Entry类是公共和作者属性以这样的方式宣布:
public String author;
所以它也是公开的。这是我的代码时,我遍历条目:
<c:forEach items="${entries}" varStatus="i">
<c:set var="entry" value="${entries[i.index]}" />
<li><c:out value="${entry.author}" /></li>
</c:forEach>
和
entry.class.name
回报guestbook.Entry
类在包留言(你可以猜),参赛矢量传递给pageContext。
我不知道我的做法有什么问题。有人能帮助我吗? (在此先感谢!)
引发StackOverflowException :)看起来,'返回context.getELResolver()。getValue( 上下文,基地,财产);'调用相同的'getValue'实现。 –