You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Christian Kaltepoth (JIRA)" <de...@myfaces.apache.org> on 2010/09/28 08:11:33 UTC

[jira] Created: (MYFACES-2931) Regression: Template areas get lost when using

Regression: Template areas get lost when using <ui:include> 
------------------------------------------------------------

                 Key: MYFACES-2931
                 URL: https://issues.apache.org/jira/browse/MYFACES-2931
             Project: MyFaces Core
          Issue Type: Bug
          Components: General
    Affects Versions: 2.0.2
            Reporter: Christian Kaltepoth


Template areas specified with <ui:define> are not visible in files that the template includes with <ui:include>.

See the following example.

The template:
http://github.com/chkal/myfaces-tests/blob/vdl-insert-bug/src/main/webapp/template.xhtml

The file included by the template:
http://github.com/chkal/myfaces-tests/blob/vdl-insert-bug/src/main/webapp/header.xhtml

The page using the template:
http://github.com/chkal/myfaces-tests/blob/vdl-insert-bug/src/main/webapp/page.xhtml

MyFaces 2.0.2 will show "Wrong Title" in the title div, which is the default value of the <ui:insert>. MyFaces 2.0.1 and Mojarra will instead display "Correct Title", which is the value definied in page.xhtml via <ui:define>.  

You can download an example application demonstrating this issue here:

http://github.com/chkal/myfaces-tests/archives/vdl-insert-bug

Start the app with:

mvn jetty:run

The page is then available here:

http://localhost:9090/


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


[jira] Commented: (MYFACES-2931) Regression: Template areas get lost when using

Posted by "Christian Kaltepoth (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/MYFACES-2931?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12916382#action_12916382 ] 

Christian Kaltepoth commented on MYFACES-2931:
----------------------------------------------

Hi Leonardo,

I think you are right. I wasn't aware of the problems described in MYFACES-2753. I originally thought that inheriting template areas to files imported via <ui:include> would be some kind of nice-to-have feature that won't break anything and is spec compliant (as the spec doesn't explicitly include a statement regarding this). I see you did some intensive research on this topic! ;-)

Keep up the good work! :-)

> Regression: Template areas get lost when using <ui:include> 
> ------------------------------------------------------------
>
>                 Key: MYFACES-2931
>                 URL: https://issues.apache.org/jira/browse/MYFACES-2931
>             Project: MyFaces Core
>          Issue Type: Bug
>          Components: General
>    Affects Versions: 2.0.2
>            Reporter: Christian Kaltepoth
>
> Template areas specified with <ui:define> are not visible in files that the template includes with <ui:include>.
> See the following example.
> The template:
> http://github.com/chkal/myfaces-tests/blob/vdl-insert-bug/src/main/webapp/template.xhtml
> The file included by the template:
> http://github.com/chkal/myfaces-tests/blob/vdl-insert-bug/src/main/webapp/header.xhtml
> The page using the template:
> http://github.com/chkal/myfaces-tests/blob/vdl-insert-bug/src/main/webapp/page.xhtml
> MyFaces 2.0.2 will show "Wrong Title" in the title div, which is the default value of the <ui:insert>. MyFaces 2.0.1 and Mojarra will instead display "Correct Title", which is the value definied in page.xhtml via <ui:define>.  
> You can download an example application demonstrating this issue here:
> http://github.com/chkal/myfaces-tests/archives/vdl-insert-bug
> Start the app with:
> mvn jetty:run
> The page is then available here:
> http://localhost:9090/

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


[jira] Commented: (MYFACES-2931) Regression: Template areas get lost when using

Posted by "Christian Kaltepoth (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/MYFACES-2931?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12916039#action_12916039 ] 

Christian Kaltepoth commented on MYFACES-2931:
----------------------------------------------

Hey Leonardo!

I just had a look at MYFACES-2925 and the JSF 2.0 spec. I think you are right. <ui:decorate> is the way to go in a scenario like this.

In my opinion the name of the tags are a bit misleading. I think most people will rather use <ui:include> if they want to "include" something in the page and they will expect <ui:insert> to work like in the main template. <ui:decorate> is more or less a "include with templating" that should be used in these cases.

Nevertheless I have a bit of a bad feeling when MyFaces changes this behavior from previous version (and what Mojarra is doing) as it will possibly break existing applications.    

> Regression: Template areas get lost when using <ui:include> 
> ------------------------------------------------------------
>
>                 Key: MYFACES-2931
>                 URL: https://issues.apache.org/jira/browse/MYFACES-2931
>             Project: MyFaces Core
>          Issue Type: Bug
>          Components: General
>    Affects Versions: 2.0.2
>            Reporter: Christian Kaltepoth
>
> Template areas specified with <ui:define> are not visible in files that the template includes with <ui:include>.
> See the following example.
> The template:
> http://github.com/chkal/myfaces-tests/blob/vdl-insert-bug/src/main/webapp/template.xhtml
> The file included by the template:
> http://github.com/chkal/myfaces-tests/blob/vdl-insert-bug/src/main/webapp/header.xhtml
> The page using the template:
> http://github.com/chkal/myfaces-tests/blob/vdl-insert-bug/src/main/webapp/page.xhtml
> MyFaces 2.0.2 will show "Wrong Title" in the title div, which is the default value of the <ui:insert>. MyFaces 2.0.1 and Mojarra will instead display "Correct Title", which is the value definied in page.xhtml via <ui:define>.  
> You can download an example application demonstrating this issue here:
> http://github.com/chkal/myfaces-tests/archives/vdl-insert-bug
> Start the app with:
> mvn jetty:run
> The page is then available here:
> http://localhost:9090/

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


[jira] Commented: (MYFACES-2931) Regression: Template areas get lost when using

Posted by "Leonardo Uribe (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/MYFACES-2931?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12915795#action_12915795 ] 

Leonardo Uribe commented on MYFACES-2931:
-----------------------------------------

Look issue MYFACES-2925, there there is some arguments why this example is considered a bug. If you want to include the header on template resolution, use ui:decorate instead ui:include.

If you agree with the arguments shown please let us now, otherwise it could be good to hear why it should behave that way

> Regression: Template areas get lost when using <ui:include> 
> ------------------------------------------------------------
>
>                 Key: MYFACES-2931
>                 URL: https://issues.apache.org/jira/browse/MYFACES-2931
>             Project: MyFaces Core
>          Issue Type: Bug
>          Components: General
>    Affects Versions: 2.0.2
>            Reporter: Christian Kaltepoth
>
> Template areas specified with <ui:define> are not visible in files that the template includes with <ui:include>.
> See the following example.
> The template:
> http://github.com/chkal/myfaces-tests/blob/vdl-insert-bug/src/main/webapp/template.xhtml
> The file included by the template:
> http://github.com/chkal/myfaces-tests/blob/vdl-insert-bug/src/main/webapp/header.xhtml
> The page using the template:
> http://github.com/chkal/myfaces-tests/blob/vdl-insert-bug/src/main/webapp/page.xhtml
> MyFaces 2.0.2 will show "Wrong Title" in the title div, which is the default value of the <ui:insert>. MyFaces 2.0.1 and Mojarra will instead display "Correct Title", which is the value definied in page.xhtml via <ui:define>.  
> You can download an example application demonstrating this issue here:
> http://github.com/chkal/myfaces-tests/archives/vdl-insert-bug
> Start the app with:
> mvn jetty:run
> The page is then available here:
> http://localhost:9090/

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


[jira] Commented: (MYFACES-2931) Regression: Template areas get lost when using

Posted by "Leonardo Uribe (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/MYFACES-2931?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12916359#action_12916359 ] 

Leonardo Uribe commented on MYFACES-2931:
-----------------------------------------

Hi Christian

Yes, the fix could possibly break existing applications but note the opposite is also true, if we don't  apply the fix, there are other examples that are valid in syntax but fails (MYFACES-2753). After thinking a lot and checking the documentation left from the original author of facelets, including check facelets cvs and issue tracking, I think the right choice was apply it (really that conclusion was very difficult to find, because that code is the less documented but most important in facelets). 

Other argument that suggest the fixed behavior is preferred is related to the attributes of ui:include and ui:decorate tag. Note that ui:decorate has  "template" attribute, but ui:include has "src" attribute. Therefore, the first one suggest the link points to a "template", but the second one suggest that it points to a "part" or "page".

> Regression: Template areas get lost when using <ui:include> 
> ------------------------------------------------------------
>
>                 Key: MYFACES-2931
>                 URL: https://issues.apache.org/jira/browse/MYFACES-2931
>             Project: MyFaces Core
>          Issue Type: Bug
>          Components: General
>    Affects Versions: 2.0.2
>            Reporter: Christian Kaltepoth
>
> Template areas specified with <ui:define> are not visible in files that the template includes with <ui:include>.
> See the following example.
> The template:
> http://github.com/chkal/myfaces-tests/blob/vdl-insert-bug/src/main/webapp/template.xhtml
> The file included by the template:
> http://github.com/chkal/myfaces-tests/blob/vdl-insert-bug/src/main/webapp/header.xhtml
> The page using the template:
> http://github.com/chkal/myfaces-tests/blob/vdl-insert-bug/src/main/webapp/page.xhtml
> MyFaces 2.0.2 will show "Wrong Title" in the title div, which is the default value of the <ui:insert>. MyFaces 2.0.1 and Mojarra will instead display "Correct Title", which is the value definied in page.xhtml via <ui:define>.  
> You can download an example application demonstrating this issue here:
> http://github.com/chkal/myfaces-tests/archives/vdl-insert-bug
> Start the app with:
> mvn jetty:run
> The page is then available here:
> http://localhost:9090/

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