javaee / mojarra

PLEASE NOTE: This project has moved to Eclipse Foundation and will be archived under the JavaEE GitHub Organization. After Feb. 1, 2021, the new location will be github.com/javaee/mojarra. Mojarra - Oracle's implementation of the JavaServer Faces specification
https://github.com/eclipse-ee4j/mojarra
Other
164 stars 58 forks source link

Improve managed property error messages #438

Closed javaserverfaces closed 17 years ago

javaserverfaces commented 18 years ago

Consider the following case:

public class BannerBean implements Serializable { private String authDetails = "My Details";

public String getAuthDetails()

{ return authDetails; }

public void setAuthDetails(String authDetails)

{ this.authDetails = authDetails; }

}

Anytime I try to bind the field authDetails to an h:outputText with:

<h:outputText value="#

{banner.authDetails}

"/>

I return the following in my Tomcat log:

javax.faces.el.EvaluationException: javax.faces.FacesException: java.lang.ClassCastException: com.dtn.petro2.petroadmin.common.BannerBean

My backing bean is defined as the following in my faces-config.xml:

Banner banner com.dtn.petro2.petroadmin.common.BannerBean session authDetails My Details

In this case, the ManagedBean implemenation would expect the managed bean to be a Map. If the managedbean is not a Map, as above, then we just throw a ClassCastException with no diagnostics to help the developer fix the issue.

We need to go through the managed bean code and improve the error messages.

Environment

Operating System: All Platform: All

Affected Versions

[1.2]

javaserverfaces commented 18 years ago

Reported by @rlubke

javaserverfaces commented 17 years ago

@rlubke said: Assigned.

javaserverfaces commented 17 years ago

@rlubke said: This was resolved as part of the larger managed bean changes checked in on April 22, 2007.

javaserverfaces commented 12 years ago

@manfredriem said: Closing issue out

javaserverfaces commented 18 years ago

Was assigned to rlubke

javaserverfaces commented 7 years ago

This issue was imported from java.net JIRA JAVASERVERFACES-434

javaserverfaces commented 17 years ago

Marked as fixed on Sunday, April 22nd 2007, 3:35:03 pm