You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Jakob Korherr (JIRA)" <de...@myfaces.apache.org> on 2010/03/25 19:09:27 UTC

[jira] Created: (MYFACES-2624) Automatically add h:messages if ProjectStage is Development

Automatically add h:messages if ProjectStage is Development
-----------------------------------------------------------

                 Key: MYFACES-2624
                 URL: https://issues.apache.org/jira/browse/MYFACES-2624
             Project: MyFaces Core
          Issue Type: Bug
          Components: JSR-314
    Affects Versions: 2.0.0-beta-3
            Reporter: Jakob Korherr
            Assignee: Jakob Korherr


If ProjectStage is Development and there is no h:messages component on the current view we should automatically add h:messages to the component tree, because many users often forget about adding this useful (debug) component and wonder why their actions are never called.

This is also an official JSF 2.0 spec requirement, however I couldn't find it in the spec-pdf or in the javadoc, but in the spec issue tracker [1] and on several blogs like Ryan Lubke's Blog [2]. Furthermore Mojarra also does it.

[1] https://javaserverfaces-spec-public.dev.java.net/issues/show_bug.cgi?id=314
[2] http://blogs.sun.com/rlubke/entry/jsf_2_0_new_feature2

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (MYFACES-2624) Automatically add h:messages if ProjectStage is Development

Posted by "Jakob Korherr (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/MYFACES-2624?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12852534#action_12852534 ] 

Jakob Korherr commented on MYFACES-2624:
----------------------------------------

The code committet works for the built-in facelets VDL when using <h:body> or just <body> in the view. This is exactly the way Mojarra deals with the problem (known from debugging).

I also found out that Mojarra adds a log message with all the unhandled FacesMessages when ProjectStage is Production, which is also kinda nice. I think we should do that too!

> Automatically add h:messages if ProjectStage is Development
> -----------------------------------------------------------
>
>                 Key: MYFACES-2624
>                 URL: https://issues.apache.org/jira/browse/MYFACES-2624
>             Project: MyFaces Core
>          Issue Type: Bug
>          Components: JSR-314
>    Affects Versions: 2.0.0-beta-3
>            Reporter: Jakob Korherr
>            Assignee: Jakob Korherr
>         Attachments: MYFACES-2624-add-UIMessages-to-UIForm.patch
>
>
> If ProjectStage is Development and there is no h:messages component on the current view we should automatically add h:messages to the component tree, because many users often forget about adding this useful (debug) component and wonder why their actions are never called.
> This is also an official JSF 2.0 spec requirement, however I couldn't find it in the spec-pdf or in the javadoc, but in the spec issue tracker [1] and on several blogs like Ryan Lubke's Blog [2]. Furthermore Mojarra also does it.
> [1] https://javaserverfaces-spec-public.dev.java.net/issues/show_bug.cgi?id=314
> [2] http://blogs.sun.com/rlubke/entry/jsf_2_0_new_feature2

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (MYFACES-2624) Automatically add h:messages if ProjectStage is Development

Posted by "Martin Marinschek (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/MYFACES-2624?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12850080#action_12850080 ] 

Martin Marinschek commented on MYFACES-2624:
--------------------------------------------

Hi Jakob,

can you please open a spec issue (against the missing documentation)?

thanks a lot,

regards,

Martin

> Automatically add h:messages if ProjectStage is Development
> -----------------------------------------------------------
>
>                 Key: MYFACES-2624
>                 URL: https://issues.apache.org/jira/browse/MYFACES-2624
>             Project: MyFaces Core
>          Issue Type: Bug
>          Components: JSR-314
>    Affects Versions: 2.0.0-beta-3
>            Reporter: Jakob Korherr
>            Assignee: Jakob Korherr
>
> If ProjectStage is Development and there is no h:messages component on the current view we should automatically add h:messages to the component tree, because many users often forget about adding this useful (debug) component and wonder why their actions are never called.
> This is also an official JSF 2.0 spec requirement, however I couldn't find it in the spec-pdf or in the javadoc, but in the spec issue tracker [1] and on several blogs like Ryan Lubke's Blog [2]. Furthermore Mojarra also does it.
> [1] https://javaserverfaces-spec-public.dev.java.net/issues/show_bug.cgi?id=314
> [2] http://blogs.sun.com/rlubke/entry/jsf_2_0_new_feature2

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (MYFACES-2624) Automatically add h:messages if ProjectStage is Development

Posted by "Jakob Korherr (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/MYFACES-2624?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12850141#action_12850141 ] 

Jakob Korherr commented on MYFACES-2624:
----------------------------------------

Actually I was going to do that today, but anyway thanks for the reminder, Martin :)

Posted spec issue #778: https://javaserverfaces-spec-public.dev.java.net/issues/show_bug.cgi?id=778

> Automatically add h:messages if ProjectStage is Development
> -----------------------------------------------------------
>
>                 Key: MYFACES-2624
>                 URL: https://issues.apache.org/jira/browse/MYFACES-2624
>             Project: MyFaces Core
>          Issue Type: Bug
>          Components: JSR-314
>    Affects Versions: 2.0.0-beta-3
>            Reporter: Jakob Korherr
>            Assignee: Jakob Korherr
>
> If ProjectStage is Development and there is no h:messages component on the current view we should automatically add h:messages to the component tree, because many users often forget about adding this useful (debug) component and wonder why their actions are never called.
> This is also an official JSF 2.0 spec requirement, however I couldn't find it in the spec-pdf or in the javadoc, but in the spec issue tracker [1] and on several blogs like Ryan Lubke's Blog [2]. Furthermore Mojarra also does it.
> [1] https://javaserverfaces-spec-public.dev.java.net/issues/show_bug.cgi?id=314
> [2] http://blogs.sun.com/rlubke/entry/jsf_2_0_new_feature2

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (MYFACES-2624) Automatically add h:messages if ProjectStage is Development

Posted by "Jakob Korherr (JIRA)" <de...@myfaces.apache.org>.
     [ https://issues.apache.org/jira/browse/MYFACES-2624?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jakob Korherr resolved MYFACES-2624.
------------------------------------

       Resolution: Fixed
    Fix Version/s: 2.0.0-beta-4

As long as the EG does not change anything about this when adding it to the spec, this is fixed.

> Automatically add h:messages if ProjectStage is Development
> -----------------------------------------------------------
>
>                 Key: MYFACES-2624
>                 URL: https://issues.apache.org/jira/browse/MYFACES-2624
>             Project: MyFaces Core
>          Issue Type: Bug
>          Components: JSR-314
>    Affects Versions: 2.0.0-beta-3
>            Reporter: Jakob Korherr
>            Assignee: Jakob Korherr
>             Fix For: 2.0.0-beta-4
>
>         Attachments: MYFACES-2624-add-UIMessages-to-UIForm.patch
>
>
> If ProjectStage is Development and there is no h:messages component on the current view we should automatically add h:messages to the component tree, because many users often forget about adding this useful (debug) component and wonder why their actions are never called.
> This is also an official JSF 2.0 spec requirement, however I couldn't find it in the spec-pdf or in the javadoc, but in the spec issue tracker [1] and on several blogs like Ryan Lubke's Blog [2]. Furthermore Mojarra also does it.
> [1] https://javaserverfaces-spec-public.dev.java.net/issues/show_bug.cgi?id=314
> [2] http://blogs.sun.com/rlubke/entry/jsf_2_0_new_feature2

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (MYFACES-2624) Automatically add h:messages if ProjectStage is Development

Posted by "Jakob Korherr (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/MYFACES-2624?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12851811#action_12851811 ] 

Jakob Korherr commented on MYFACES-2624:
----------------------------------------

After digging into to issue, I have to say I am a little confused. The spec issue #314 says to automatically add a h:messages as the last child of every UIForm if there is no UIMessages in the view.

However there are some problems with this approach. At first the presence of an UIMessages does not mean that every FacesMessage is really displayed (e.g. if the attribute for is set). Furthermore we would have to traverse the whole tree to find out if there really are UIMessages or not, because we can't rely on our facelet handlers or JSP tag handlers to find out if there is an h:messages component, because the user might use a custom messages component (like e.g. the one from tomahawk).

The easiest way to determine if every FacesMessage really has been rendered is to check FacesMessage.isRendered() on every FacesMessage, but we can only check this after the rendering has happened and thus we won't be able to add the h:messages component any more.

Using <ui:debug /> on Mojarra to see how it deals with this scenario I found out that it does not add an UIMessages component at all. It seems to hook into the rendering phase before the body tag is closed (and not at the end of every form like the spec issue says) and to just add the HTML from the h:messages renderer to the output without adding the component itself to the tree. Thus, Mojarra does not change the component tree at all, which is kinda nice!

I will try some things out to find the best fitting solution to this problem. Suggestions are always welcome!!

> Automatically add h:messages if ProjectStage is Development
> -----------------------------------------------------------
>
>                 Key: MYFACES-2624
>                 URL: https://issues.apache.org/jira/browse/MYFACES-2624
>             Project: MyFaces Core
>          Issue Type: Bug
>          Components: JSR-314
>    Affects Versions: 2.0.0-beta-3
>            Reporter: Jakob Korherr
>            Assignee: Jakob Korherr
>
> If ProjectStage is Development and there is no h:messages component on the current view we should automatically add h:messages to the component tree, because many users often forget about adding this useful (debug) component and wonder why their actions are never called.
> This is also an official JSF 2.0 spec requirement, however I couldn't find it in the spec-pdf or in the javadoc, but in the spec issue tracker [1] and on several blogs like Ryan Lubke's Blog [2]. Furthermore Mojarra also does it.
> [1] https://javaserverfaces-spec-public.dev.java.net/issues/show_bug.cgi?id=314
> [2] http://blogs.sun.com/rlubke/entry/jsf_2_0_new_feature2

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.