ICEfaces
  1. ICEfaces
  2. ICE-5218

compat-showcase shows warning messages on textInput to server console for facesmessages

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0-Alpha1
    • Fix Version/s: 2.0-Alpha2, 2.0.0
    • Component/s: Framework
    • Labels:
      None
    • Environment:
      jsf2.0, ICEfaces2.0, compat jars

      Description

      The warning messages go to the server log if a facesMessage is queued. See the Text Entry example in compat-showcase. If you enter any password < 6 characters in length and exit the field, the facesMessage should be enqueued, but the following message displays in the server log:-
      Dec 15, 2009 1:35:31 PM com.sun.faces.renderkit.RenderKitUtils renderUnhandledMessages
      INFO: WARNING: FacesMessage(s) have been enqueued, but may not have been displayed.
      sourceId=iceform:TxtPw[severity=(ERROR 2), summary=(Enter no less than 6 characters), detail=(Enter no less than 6 characters)]
      Dec 15, 2009 1:35:35 PM com.sun.faces.renderkit.RenderKitUtils renderUnhandledMessages
      INFO: WARNING: FacesMessage(s) have been enqueued, but may not have been displayed.
      sourceId=iceform:TxtPw[severity=(ERROR 2), summary=(Enter no less than 6 characters), detail=(Enter no less than 6 characters)]
      If you exit the field and go to another, then come regain focus, the warnings again appear in the server console.

      Occasionally, the following exception has appeared (inconsistent--unable to reproduce more than once):-
      INFO: WARNING: FacesMessage(s) have been enqueued, but may not have been displayed.
      sourceId=iceform:TxtPw[severity=(ERROR 2), summary=(Input is required), detail=(Input is required)]
      javax.faces.application.ViewExpiredException: viewId:/showcase.jsf - View /showcase.jsf could not be restored.
      at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:212)
      at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
      at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:110)
      at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:310)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
      at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
      at java.lang.Thread.run(Thread.java:619)

        Issue Links

          Activity

          Hide
          Judy Guglielmin added a comment -

          This is similar to ICE-1900 (fixed for 1.8.2.GA), however the classes that were reworked to resolve this jira no longer exist in 2.0.

          Show
          Judy Guglielmin added a comment - This is similar to ICE-1900 (fixed for 1.8.2.GA), however the classes that were reworked to resolve this jira no longer exist in 2.0.
          Hide
          Judy Guglielmin added a comment -

          MORE SERIOUS.....

          The invalid fields are blocking input submitted to the other input fields. For example, if you leave the Name empty (you get "Input is required" for FacesMessage and that field is invalid. However, you should still be able to enter values into the Comments box and have that come through to Server-side Backing Bean Values (at bottom of page). Invalid values are blocking other fields from updating backing bean.

          Show
          Judy Guglielmin added a comment - MORE SERIOUS..... The invalid fields are blocking input submitted to the other input fields. For example, if you leave the Name empty (you get "Input is required" for FacesMessage and that field is invalid. However, you should still be able to enter values into the Comments box and have that come through to Server-side Backing Bean Values (at bottom of page). Invalid values are blocking other fields from updating backing bean.
          Hide
          Deryk Sinotte added a comment -

          This looks very much the same as the issue in ICE-1900 but the code has changed significantly between JSF 1.x and 2.x so a different approach is required rather than just porting the previous fix.

          Currently, from my observations of Mojarra, the FacesMessage API has been extended to include this:

          /**

          • <p>Marks this message as having been rendered to the client.</p>
            *
          • @since 2.0
            */
            public void rendered() { this.rendered = true; }

          This method is used by the com.sun.faces.renderkit.html_basic.MessageRenderer to mark messages that have been rendered out to the client. Later on, logic in the RenderKitUtils uses this flag to identify FacesMessages as being successfully delivered to the client. At this point it looks like that the logic is not being applied in our case and the various messages (e.g. Validation messages) are being detected and logged.

          Show
          Deryk Sinotte added a comment - This looks very much the same as the issue in ICE-1900 but the code has changed significantly between JSF 1.x and 2.x so a different approach is required rather than just porting the previous fix. Currently, from my observations of Mojarra, the FacesMessage API has been extended to include this: /** <p>Marks this message as having been rendered to the client.</p> * @since 2.0 */ public void rendered() { this.rendered = true; } This method is used by the com.sun.faces.renderkit.html_basic.MessageRenderer to mark messages that have been rendered out to the client. Later on, logic in the RenderKitUtils uses this flag to identify FacesMessages as being successfully delivered to the client. At this point it looks like that the logic is not being applied in our case and the various messages (e.g. Validation messages) are being detected and logged.
          Hide
          Deryk Sinotte added a comment -

          Looks more and more like we'll need to make an adjustment to our own MessageRenderer and MessagesRenderers implementation. In Mojarra, these renderers execute very similar code to mark FacesMessages as being rendered. They both look similar to this:

          ... FacesMessage curMessage = (FacesMessage) messageIter.next();
          if (curMessage.isRendered() && !messages.isRedisplay())

          { continue; }

          curMessage.rendered();
          ...

          The FacesMessage.rendered() method is new to JSF 2.0 and allows the renderer to note that the FacesMessage has been rendered out, so that later, when RenderKitUtils checks to see if there are any FacesMessages that have not been rendered for some reason, the ones that have had rendered() called on them are suitably flagged. In our own compatibility mode renderers, we don't currently do this yet since the API is new.

          Show
          Deryk Sinotte added a comment - Looks more and more like we'll need to make an adjustment to our own MessageRenderer and MessagesRenderers implementation. In Mojarra, these renderers execute very similar code to mark FacesMessages as being rendered. They both look similar to this: ... FacesMessage curMessage = (FacesMessage) messageIter.next(); if (curMessage.isRendered() && !messages.isRedisplay()) { continue; } curMessage.rendered(); ... The FacesMessage.rendered() method is new to JSF 2.0 and allows the renderer to note that the FacesMessage has been rendered out, so that later, when RenderKitUtils checks to see if there are any FacesMessages that have not been rendered for some reason, the ones that have had rendered() called on them are suitably flagged. In our own compatibility mode renderers, we don't currently do this yet since the API is new.
          Hide
          Deryk Sinotte added a comment -

          Assigning to Ken to re-assign to the components team. I've added comments about what I believe needs to be done. I'll be happy to consult with whoever is going to be working on it.

          Show
          Deryk Sinotte added a comment - Assigning to Ken to re-assign to the components team. I've added comments about what I believe needs to be done. I'll be happy to consult with whoever is going to be working on it.
          Hide
          Adnan Durrani added a comment -

          New API integrated as mentioned by the Deryk.

          Modified: D:\work\development\head\svn\ossrepo\icefaces\scratchpads\glimmer\compat\core\src\main\java\com\icesoft\faces\renderkit\dom_html_basic\MessageRenderer.java
          Modified: D:\work\development\head\svn\ossrepo\icefaces\scratchpads\glimmer\compat\core\src\main\java\com\icesoft\faces\renderkit\dom_html_basic\MessagesRenderer.java
          Sending content: D:\work\development\head\svn\ossrepo\icefaces\scratchpads\glimmer\compat\core\src\main\java\com\icesoft\faces\renderkit\dom_html_basic\MessageRenderer.java
          Sending content: D:\work\development\head\svn\ossrepo\icefaces\scratchpads\glimmer\compat\core\src\main\java\com\icesoft\faces\renderkit\dom_html_basic\MessagesRenderer.java
          Completed: At revision: 20196

          Show
          Adnan Durrani added a comment - New API integrated as mentioned by the Deryk. Modified: D:\work\development\head\svn\ossrepo\icefaces\scratchpads\glimmer\compat\core\src\main\java\com\icesoft\faces\renderkit\dom_html_basic\MessageRenderer.java Modified: D:\work\development\head\svn\ossrepo\icefaces\scratchpads\glimmer\compat\core\src\main\java\com\icesoft\faces\renderkit\dom_html_basic\MessagesRenderer.java Sending content: D:\work\development\head\svn\ossrepo\icefaces\scratchpads\glimmer\compat\core\src\main\java\com\icesoft\faces\renderkit\dom_html_basic\MessageRenderer.java Sending content: D:\work\development\head\svn\ossrepo\icefaces\scratchpads\glimmer\compat\core\src\main\java\com\icesoft\faces\renderkit\dom_html_basic\MessagesRenderer.java Completed: At revision: 20196
          Hide
          Adnan Durrani added a comment -

          Judy mentioned that rowSelector demo still shows messages:

          12-Jan-2010 1:32:05 PM com.sun.faces.renderkit.RenderKitUtils renderUnhandledMessages
          INFO: WARNING: FacesMessage(s) have been enqueued, but may not have been displayed.
          sourceId=iceform:multipleSelection[severity=(ERROR 2), summary=(iceform:multipleSelection: Validatio
          n Error: Value is not valid), detail=(iceform:multipleSelection: Validation Error: Value is not vali
          d)]

          Show
          Adnan Durrani added a comment - Judy mentioned that rowSelector demo still shows messages: 12-Jan-2010 1:32:05 PM com.sun.faces.renderkit.RenderKitUtils renderUnhandledMessages INFO: WARNING: FacesMessage(s) have been enqueued, but may not have been displayed. sourceId=iceform:multipleSelection[severity=(ERROR 2), summary=(iceform:multipleSelection: Validatio n Error: Value is not valid), detail=(iceform:multipleSelection: Validation Error: Value is not vali d)]
          Hide
          Adnan Durrani added a comment -

          I looked at the rowSelector demo, it seems like some validation being failed which queues a faces message, and on the page none of the message or messages being used, so that is why JSF tells that there is a message but never displayed which is expected behavior.

          Show
          Adnan Durrani added a comment - I looked at the rowSelector demo, it seems like some validation being failed which queues a faces message, and on the page none of the message or messages being used, so that is why JSF tells that there is a message but never displayed which is expected behavior.

            People

            • Assignee:
              Adnan Durrani
              Reporter:
              Judy Guglielmin
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: