javaserverfaces-spec-public
  1. javaserverfaces-spec-public
  2. JAVASERVERFACES_SPEC_PUBLIC-204

Consider the use of converters when initializing managed bean properties.

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Incomplete
    • Affects Version/s: 1.2
    • Fix Version/s: 1.2
    • Component/s: Uncategorized
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: Sun

    • Issuezilla Id:
      204
    • Status Whiteboard:
      Hide

      EGEasy5 effort_moderate

      Show
      EGEasy5 effort_moderate

      Description

      I would like to be able to use the managed-bean/managed-property/value within a
      faces-config to directly set an initial value on a managed bean, when the
      property-class is NOT one of the primitives. For example, I have
      a "URLConverter" and want to do something like this:

      <converter>
      <description>Converter for URLs</description>
      <converter-for-class>java.net.URL</converter-for-class>
      <converter-class>
      tools.webservice.tester.converters.URLConverter
      </converter-class>
      </converter>

      <managed-bean>
      <description>
      The backing bean to track the currently selected WSDL
      </description>
      <managed-bean-name>WsdlSelection</managed-bean-name>
      <managed-bean-class>
      tools.webservice.tester.WsdlSelection
      </managed-bean-class>
      <managed-bean-scope>session</managed-bean-scope>
      <managed-property>
      <property-name>wsdlLocation</property-name>
      <property-class>java.net.URL</property-class>
      <value>http://cyber-
      tdr:8080/CountryInfoBeanService/CountryInfoBean?wsdl</value>
      </managed-property>
      </managed-bean>

      However, this fails in the current implementation of
      com.sun.faces.config.ManagedBeanFactoryImpl.newInstance because the function
      eventually calls "getConvertedValueConsideringPrimitives" and can only handle
      primitives, enums and Strings. It would be helpful if the converters could be
      employed (perhaps through an extra "convert" attribute or element within the
      <managed-property> element).

      A second alternative (but not quite as useful) would be to check for a
      constructor for "valueType" that takes a single argument that is assignable
      from the the source value class, and use that to instantiate the object.

      This may not be an issue if the JSP Expression Language had a way to directly
      invoke a method on an object – then I could use some syntax like '#

      {j:newObject ("java.net.URL", "http://....")}

      '. I know I can define a custom tag library to
      do this, but it would be nice if it was standardized.

        Issue Links

          Activity

          Hide
          Ryan Lubke added a comment -

          57 is an umbrella issue for this one.

          Show
          Ryan Lubke added a comment - 57 is an umbrella issue for this one.
          Hide
          Ed Burns added a comment -

          wb

          Show
          Ed Burns added a comment - wb
          Hide
          Ed Burns added a comment -

          Prepare to delete "spec" subcomponent.

          Show
          Ed Burns added a comment - Prepare to delete "spec" subcomponent.
          Hide
          Ed Burns added a comment -

          Push to CDI. Only that CDI doesn't have a converter concept.

          Show
          Ed Burns added a comment - Push to CDI. Only that CDI doesn't have a converter concept.
          Hide
          Ed Burns added a comment -

          Move all to 1.2

          Show
          Ed Burns added a comment - Move all to 1.2
          Hide
          Manfred Riem added a comment -

          Closing resolved issue out

          Show
          Manfred Riem added a comment - Closing resolved issue out

            People

            • Assignee:
              javaserverfowner
              Reporter:
              Ryan Lubke
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: