Hello,

 

I have two problems with MyFaces 1.1.1.

 

1). I have created page:

. . . .

<h:selectBooleanCheckbox id="checkbox" value="#{Bean.prop}"/>

. . . .

It is uses managed bean:

public class Bean {

    public String getProp() {

        return "true";

    }

}

 

During page rendering, MyJSF throws exception: “java.lang.IllegalArgumentException: Expected submitted value of type Boolean”. However, by specification (JSF 1.1 spec: Section 5.1.3 and JSP 2.0 spec: Section 2.8.5), string "true" must be converted to Boolean by Boolean.valueOf() method.

 

2). Page:

. . . .

<h:selectOneMenu id="menu" value="#{Bean.prop}">

      <f:selectItem itemValue="1" itemLabel="1"/>

      <f:selectItem itemValue="2" itemLabel="2"/>

      <f:selectItem itemValue="3" itemLabel="3"/>

</h:selectOneMenu>

. . . .

This time following beans used:

public class Bean {

      public Prop getProp() {

            return new Prop();

      }

}

 

public class Prop {

      public String toString() {

            return "2";

      }

}

 

Page rendering fails with exception: “java.lang.IllegalArgumentException: Value is no String and component form_id:menu does not have a Converter”. By specification (JSF 1.1 spec: Section 5.1.3 and JSP 2.0 spec: Section 2.8.2), Prop object must be converted to String by Prop.toString() method.

 

With Sun JSF RI both these examples works properly. Is this MyJSF bugs or I have made something wrong?

 

______

 

With Best Regards,
Nikita Belov

 

Reply via email to