0 Replies Latest reply on Aug 4, 2006 11:01 AM by Basel Al-Mustafa

    Disable converters for request parameters in the URL

    Basel Al-Mustafa Newbie

      How can I disable auto convertion for request parameters that are of type Integer? I'm not sure but it looks like that Seam perform the conversion during the render response phase. In my component I have this:

      @RequestParameter("pn")
      @Out(value="pn", required=false)
      private Integer pageNumber = -1;
      


      17:27:58,181 ERROR [STDERR] Aug 4, 2006 5:27:58 PM com.sun.faces.lifecycle.LifecycleImpl phase
      WARNING: phase(RENDER_RESPONSE 6,com.sun.faces.context.FacesContextImpl@a303147) threw exception: javax.faces.el.EvaluationException: javax.faces.convert.ConverterException: j_id0: '-' must be a number consisting of one or more digits. javax.faces.convert.ConverterException: j_id0: '-' must be a number consisting of one or more digits.
      com.sun.faces.application.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:91)
      org.jboss.seam.core.Pages.callAction(Pages.java:161)
      org.jboss.seam.core.Pages.callAction(Pages.java:143)
      org.jboss.seam.jsf.AbstractSeamPhaseListener.callPageActions(AbstractSeamPhaseListener.java:128)
      org.jboss.seam.jsf.AbstractSeamPhaseListener.beforeRender(AbstractSeamPhaseListener.java:98)
      org.jboss.seam.jsf.SeamPhaseListener.beforePhase(SeamPhaseListener.java:50)
      org.jboss.seam.jsf.SeamExtendedManagedPersistencePhaseListener.beforePhase(SeamExtendedManagedPersistencePhaseListener.java:38)
      com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:249)
      com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:159)
      javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
      org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
      org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      org.jboss.seam.servlet.SeamExceptionFilter.doFilter(SeamExceptionFilter.java:45)
      org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
      org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      org.jboss.seam.servlet.SeamRedirectFilter.doFilter(SeamRedirectFilter.java:30)
      org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
      org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
      org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
      org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
      org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
      org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
      org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
      org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
      org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
      org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
      org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
      org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
      org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
      org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
      org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
      org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
      java.lang.Thread.run(Thread.java:595)
      


      If that is not possible then I will have to change it to String, parse to int and catch any number format exception.