10 Replies Latest reply on May 7, 2007 11:00 AM by Hannes Schulz

    validation message displayed twice

    Hannes Schulz Newbie

      Hi,

      i have a question. I want to validate a parameter against a hibternate constraint.

      I have the following code in the bean:

      @Min(value=1,message="#{messages.GreaterThanZero}")
      public float getArea()
      {
       return area;
      }


      and the input-field is defined:

      <h:inputText id="EffectiveArea" value="#{calculator.area}" required="true" requiredMessage="#{messages.RequiredValueArea}">
       <f:converter converterId="AreaConverter"/>
      </h:inputText>


      when i display the message in the view page with <h:messages/> the error message is displayed twice. when i add the globalOnly="true" - tag no message is displayed.

      I have no clue why this happens.

      regards,
      hasc

        • 1. Re: validation message displayed twice
          Hannes Schulz Newbie

          would be great if anyone could give me a hint here.

          regards,
          hasc

          • 2. Re: validation message displayed twice
            Pete Muir Master

            *which* error message is displayed twice?

            <h:message globalOnly="true" />


            doesn't display messages targeted at particular JSF components, only those which aren't attached to any.

            • 3. Re: validation message displayed twice
              Hannes Schulz Newbie

              thanks for help.

              i defined a message text in messages.properties

              GreaterThanZero=some text

              when i enter e.g. 0 as value the message text for "GreaterThanZero" is displayed twice.

              i just set globalOnly="true" to check if the message is bound to the component.

              • 4. Re: validation message displayed twice
                Pete Muir Master

                What version of Seam and which JSF impl are you using?

                • 5. Re: validation message displayed twice
                  Hannes Schulz Newbie

                  jboss-seam-1.2.1.GA
                  jsf1.2
                  with facelets

                  • 7. Re: validation message displayed twice
                    Hannes Schulz Newbie

                    thanks i ll try that

                    • 8. Re: validation message displayed twice
                      Damian Harvey Master

                      Do you have showDetail="true"? If so, try removing it.

                      I had the same issue and this was the cause for me.

                      • 9. Re: validation message displayed twice
                        Hannes Schulz Newbie

                        @damianharvey

                        i tried that without any effect. but thanks for the hint.

                        • 10. Re: validation message displayed twice
                          Hannes Schulz Newbie

                          i checked out the head revision from anoncvs.forge.jboss.com.
                          i compiled it and packaged the jboss-seam*.jars into my ear. now i get the following error message when deploying the new ear.

                          com.sun.facelets.FaceletException: Could not instantiate feature[compiler.ExpressionFactory]: org.jboss.el.ExpressionFactoryImpl
                           at com.sun.facelets.compiler.Compiler.featureInstance(Compiler.java:154)
                           at com.sun.facelets.compiler.Compiler.createExpressionFactory(Compiler.java:128)
                           at com.sun.facelets.impl.DefaultFaceletFactory.createFacelet(DefaultFaceletFactory.java:198)
                           at com.sun.facelets.impl.DefaultFaceletFactory.getFacelet(DefaultFaceletFactory.java:144)
                           at com.sun.facelets.impl.DefaultFaceletFactory.getFacelet(DefaultFaceletFactory.java:95)
                           at com.sun.facelets.FaceletViewHandler.buildView(FaceletViewHandler.java:496)
                           at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:546)
                           at org.ajax4jsf.framework.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
                           at org.ajax4jsf.framework.ajax.AjaxViewHandler.renderView(AjaxViewHandler.java:229)
                           at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:108)
                           at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:266)
                           at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:159)
                           at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
                           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:96)
                           at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:220)
                           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
                           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                           at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:63)
                           at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:60)
                           at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
                           at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:57)
                           at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
                           at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:79)
                           at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
                           at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
                           at org.jboss.seam.web.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:49)
                           at org.jboss.seam.web.SeamFilter.doFilter(SeamFilter.java:84)
                           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
                           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                           at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
                           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
                           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
                           at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
                           at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
                           at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
                           at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
                           at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
                           at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
                           at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
                           at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
                           at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
                           at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
                           at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
                           at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
                           at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
                           at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
                           at java.lang.Thread.run(Thread.java:595)
                          
                          


                          did i check out the wrong files or where have a made a mistake?

                          thanks for any help
                          regards,
                          hasc