Problem with JSTL and weblogic

Posted by Jeune on Stack Overflow See other posts from Stack Overflow or by Jeune
Published on 2010-05-17T05:15:36Z Indexed on 2010/05/17 5:20 UTC
Read the original article Hit count: 389

Filed under:
|
|

I get the following error when I run my java ee app on weblogic,

javax.servlet.jsp.el.ELException: Cannot find PropertyDescriptor for 'name' for bean 'class java.lang.String'

I want to print a list of artists with the following class,

    public class Artist {
    private int id; 
    private String name;
    private String genre;

    public Artist() {

    }
    public Artist(String name){
        this.name=name;
    }
    public void setId(int id) {
        this.id = id;
    }   
    public int getId() {
        return id;
    }
     public void setName(String name) {
        this.name = name;
    }
     public String getName() {
        return name;
    }
     public String getGenre() {
        return genre;
    }
     public void setGenre(String genre) {
        this.genre = genre;
    }
}

The following lines of code seem to be causing the problem because when I remove it I don't get the error anymore.

<c:forEach items="artists" var="artist">
    <c:out value="${artist.name}"></c:out><br/>
</c:forEach>

When I use PrintWriter to print, it works:

for (Artist artist:artists){
    resp.getWriter().println(artist.getName());
}

I am using java ee 2.4 and weblogic 9.2

© Stack Overflow or respective owner

Related posts about weblogic9.x

Related posts about jstl