2 Replies Latest reply on Jun 16, 2009 2:13 PM by Robert Shanahan

    RequestParameter type conversion

    Robert Shanahan Newbie

      Do @RequestParameter and <f:param/> not convert dates?


      I have a bean with:



      @RequestParameter(name="selectedDate")
      private Date selectedDate;



      and jsf:



      <rich:menuItem value="#{messages.summaryItem}" 
         id="summary" action="#{recManager.search}">
         <f:param name="entity" value="#{userManager.defaultEntity}"/>
         <f:param name="selectedDate" value="#{userManager.defaultDate}" />
         <s:conversationPropagation type="none"/>
      </rich:menuItem>
      


      which results in the following stack trace when the menu item is clicked:



      Caused by: javax.faces.convert.ConverterException: _viewRoot: '[object Object]' could not be understood as a date.
              at javax.faces.convert.DateTimeConverter.getAsObject(DateTimeConverter.java:401)
              at org.jboss.seam.faces.DateConverter.getAsObject(DateConverter.java:109)
              at org.jboss.seam.faces.Parameters.convertRequestParameter(Parameters.java:48)
              at org.jboss.seam.web.Parameters.convertMultiValueRequestParameter(Parameters.java:74)
              at org.jboss.seam.Component.injectParameters(Component.java:1589)
              at org.jboss.seam.Component.inject(Component.java:1556)
              at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:61)
              at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
              at org.jboss.seam.core.ConversationInterceptor.aroundInvoke(ConversationInterceptor.java:65)
              at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
              at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44)
              at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
              at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
              at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:185)
              at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:103)
              at com.alas.i2i.web.reconciliation.I2iRecManager_$$_javassist_seam_13.create(I2iRecManager_$$_javassist_seam_13.java)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:585)
              at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
              at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:144)
              at org.jboss.seam.Component.callComponentMethod(Component.java:2249)
              at org.jboss.seam.Component.callCreateMethod(Component.java:2172)
              at org.jboss.seam.Component.newInstance(Component.java:2132)
              ... 69 more
      



      Do I need to use pages <param /> instead?