문제

Entity:

package entity;

import java.io.Serializable;

public class Authors implements Serializable {

    private String AuthFirstName;

    public Authors() {
    }

    public String getAuthFirstName() {
        return AuthFirstName;
    }

    public void setAuthFirstName(String AuthFirstName) {
        this.AuthFirstName = AuthFirstName;
    }

}

Servlet:

 List listAuthors = authDAO.findAuthors();
 request.setAttribute("lista", listAuthors);

JSP:

<c:forEach var="var" items="${lista}">
    <c:out value="${var.AuthFirstName}"/>
</c:forEach>

Exception:

javax.el.PropertyNotFoundException: Property 'AuthFirstName' not found on type entity.Authors

How is this caused and how can I solve it?

도움이 되었습니까?

해결책

It should start with lowercase.

<c:out value="${var.authFirstName}" />

Further, it would also be nice to fix the underlying property name to start with lowercase as well, although it does functionally not harm.

private String authFirstName;

See also:

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top