dev@javaserverfaces.java.net

[REVIEW] Correct exception type thrown by Implicit object resolver for JSP

From: Ryan Lubke <Ryan.Lubke_at_Sun.COM>
Date: Mon, 13 Jun 2005 14:53:48 -0400

SECTION: Modified Files
----------------------------
M src/com/sun/faces/el/ImplicitObjectELResolverForJsp.java
    - Spec states that a PropertyNotWritableException must be thrown
      by setValue() when view or facesContext are the resolved properties


SECTION: Diffs
----------------------------
Index: src/com/sun/faces/el/ImplicitObjectELResolverForJsp.java
===================================================================
RCS file:
/cvs/javaserverfaces-sources/jsf-ri/src/com/sun/faces/el/ImplicitObjectELResolverForJsp.java,v
retrieving revision 1.2
diff -u -r1.2 ImplicitObjectELResolverForJsp.java
--- src/com/sun/faces/el/ImplicitObjectELResolverForJsp.java 1 Jun
2005 14:03:34 -0000 1.2
+++ src/com/sun/faces/el/ImplicitObjectELResolverForJsp.java 13 Jun
2005 18:49:24 -0000
@@ -17,6 +17,7 @@
 import javax.el.ELException;
 import javax.el.ELResolver;
 import javax.el.PropertyNotFoundException;
+import javax.el.PropertyNotWritableException;
 import javax.faces.component.UIViewRoot;
 import javax.faces.context.FacesContext;
 
@@ -105,10 +106,10 @@
         }
         switch (index) {
             case FACES_CONTEXT:
- throw new ELException(Util.getExceptionMessageString
+ throw new
PropertyNotWritableException(Util.getExceptionMessageString
                 (Util.OBJECT_IS_READONLY, new String[]{"facesContext"}));
             case VIEW:
- throw new ELException(Util.getExceptionMessageString
+ throw new
PropertyNotWritableException(Util.getExceptionMessageString
                 (Util.OBJECT_IS_READONLY, new String[]{"view"}));
             default:
         }