0 Replies Latest reply on May 1, 2007 4:37 PM by John Weidner

    EvaluationException: Cannot set value for expression

    John Weidner Newbie

      I just started to try to use ajax4jsf with my "JBoss Seam" based application. But I get the following exception:

      javax.faces.el.EvaluationException: Cannot set value for expression '#{club.code}' to a new value of type java.lang.Stri
      ng
       at org.apache.myfaces.el.ValueBindingImpl.setValue(ValueBindingImpl.java:310)
       at org.jboss.seam.core.Expressions$1.setValue(Expressions.java:61)
       at org.jboss.seam.core.Pages.applyViewRootValues(Pages.java:561)
       at org.jboss.seam.jsf.AbstractSeamPhaseListener.beforeUpdateModelValues(AbstractSeamPhaseListener.java:151)
       at org.jboss.seam.jsf.SeamPhaseListener.beforePhase(SeamPhaseListener.java:55)
       at org.apache.myfaces.lifecycle.PhaseListenerManager.informPhaseListenersBefore(PhaseListenerManager.java:70)
       at org.apache.myfaces.lifecycle.LifecycleImpl.applyRequestValues(LifecycleImpl.java:207)
       at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:71)
       at javax.faces.webapp.FacesServlet.service(FacesServlet.java:137)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:75)
       at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:213)


      It appears that this problem is triggered by having a page param with the same name as a Seam component. For example, if I have in my pages.xml file the following:

      <page view-id="*">
       <param name="club" value="#{club.code}" />
       </page>


      But I also have a Seam component, named club, such as:

      @Name("club")
      @Scope(SESSION)
      public class Club implements Serializable {
       private String code = "0";
       public String getCode() {
       return code ;
       }
      
       public void setCode( String code ) {
       this.code = code ;
       }
      }
      

      then the exception happens. However, if I change the pages.xml file to say:

      <param name="clb" value="#{club.code}" />


      then it works fine.