You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Dmitry Kukushkin (JIRA)" <de...@myfaces.apache.org> on 2012/06/26 15:31:42 UTC

[jira] [Created] (MYFACES-3575) Disable relative location caching in DefaultFaceletFactory

Dmitry Kukushkin created MYFACES-3575:
-----------------------------------------

             Summary: Disable relative location caching in DefaultFaceletFactory
                 Key: MYFACES-3575
                 URL: https://issues.apache.org/jira/browse/MYFACES-3575
             Project: MyFaces Core
          Issue Type: Improvement
          Components: Extension Feature
    Affects Versions: 2.0.14
         Environment: Linux
            Reporter: Dmitry Kukushkin
            Priority: Minor


In some circumstances the caching of the relative location in the public Facelet getFacelet(String uri) in DefaultFaceletFactory is not desirable: e.g. return the mobile and full content version for the same URI, if the user changes the content type on the fly. Now this caching always causes the same content to be returned.
Should it be possible to switch it off like it is done for other caches in this class with needsToBeRefreshed check and NO_CACHE_DELAY configuration parameter?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (MYFACES-3575) Disable relative location caching in DefaultFaceletFactory

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

Dmitry Kukushkin commented on MYFACES-3575:
-------------------------------------------

Still no good, using 2.1.8. My problem is that in public Facelet getFacelet(String uri) relative location is unconditionally cached, while in my case _resolver.resolveUrl(path) can return different URLs for the same path, depending on the application's internal state. The caching of the outcome of _resolver.resolveUrl(path) breaks this.
                
> Disable relative location caching in DefaultFaceletFactory
> ----------------------------------------------------------
>
>                 Key: MYFACES-3575
>                 URL: https://issues.apache.org/jira/browse/MYFACES-3575
>             Project: MyFaces Core
>          Issue Type: Improvement
>          Components: Extension Feature
>    Affects Versions: 2.0.14
>         Environment: Linux
>            Reporter: Dmitry Kukushkin
>            Assignee: Leonardo Uribe
>            Priority: Minor
>
> In some circumstances the caching of the relative location in the public Facelet getFacelet(String uri) in DefaultFaceletFactory is not desirable: e.g. return the mobile and full content version for the same URI, if the user changes the content type on the fly. Now this caching always causes the same content to be returned.
> Should it be possible to switch it off like it is done for other caches in this class with needsToBeRefreshed check and NO_CACHE_DELAY configuration parameter?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (MYFACES-3575) Disable relative location caching in DefaultFaceletFactory

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

Leonardo Uribe commented on MYFACES-3575:
-----------------------------------------

Now I get it what you want. I don't think it could be possible, because this quickly leads to inconsistencies. Maybe what you are looking for is PrettyFaces, which allows to rewrite the url based on different conditions. No need to do anything here.
                
> Disable relative location caching in DefaultFaceletFactory
> ----------------------------------------------------------
>
>                 Key: MYFACES-3575
>                 URL: https://issues.apache.org/jira/browse/MYFACES-3575
>             Project: MyFaces Core
>          Issue Type: Improvement
>          Components: Extension Feature
>    Affects Versions: 2.0.14, 2.1.8
>         Environment: Linux
>            Reporter: Dmitry Kukushkin
>            Assignee: Leonardo Uribe
>            Priority: Minor
>
> In some circumstances the caching of the relative location in the public Facelet getFacelet(String uri) in DefaultFaceletFactory is not desirable: e.g. return the mobile and full content version for the same URI, if the user changes the content type on the fly. Now this caching always causes the same content to be returned.
> Should it be possible to switch it off like it is done for other caches in this class with needsToBeRefreshed check and NO_CACHE_DELAY configuration parameter?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Reopened] (MYFACES-3575) Disable relative location caching in DefaultFaceletFactory

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

Dmitry Kukushkin reopened MYFACES-3575:
---------------------------------------


Still no good, using 2.1.8. My problem is that in public Facelet getFacelet(String uri) relative location is unconditionally cached, while in my case _resolver.resolveUrl(path) can return different URLs for the same path, depending on the application's internal state. The caching of the outcome of _resolver.resolveUrl(path) breaks this. 
                
> Disable relative location caching in DefaultFaceletFactory
> ----------------------------------------------------------
>
>                 Key: MYFACES-3575
>                 URL: https://issues.apache.org/jira/browse/MYFACES-3575
>             Project: MyFaces Core
>          Issue Type: Improvement
>          Components: Extension Feature
>    Affects Versions: 2.0.14, 2.1.8
>         Environment: Linux
>            Reporter: Dmitry Kukushkin
>            Assignee: Leonardo Uribe
>            Priority: Minor
>
> In some circumstances the caching of the relative location in the public Facelet getFacelet(String uri) in DefaultFaceletFactory is not desirable: e.g. return the mobile and full content version for the same URI, if the user changes the content type on the fly. Now this caching always causes the same content to be returned.
> Should it be possible to switch it off like it is done for other caches in this class with needsToBeRefreshed check and NO_CACHE_DELAY configuration parameter?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (MYFACES-3575) Disable relative location caching in DefaultFaceletFactory

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

Leonardo Uribe commented on MYFACES-3575:
-----------------------------------------

_relativeLocations do not expire. Look again the code, and you'll see the code for compositeComponentMetadataFacelets is just a copy of the default one.
                
> Disable relative location caching in DefaultFaceletFactory
> ----------------------------------------------------------
>
>                 Key: MYFACES-3575
>                 URL: https://issues.apache.org/jira/browse/MYFACES-3575
>             Project: MyFaces Core
>          Issue Type: Improvement
>          Components: Extension Feature
>    Affects Versions: 2.0.14, 2.1.8
>         Environment: Linux
>            Reporter: Dmitry Kukushkin
>            Assignee: Leonardo Uribe
>            Priority: Minor
>
> In some circumstances the caching of the relative location in the public Facelet getFacelet(String uri) in DefaultFaceletFactory is not desirable: e.g. return the mobile and full content version for the same URI, if the user changes the content type on the fly. Now this caching always causes the same content to be returned.
> Should it be possible to switch it off like it is done for other caches in this class with needsToBeRefreshed check and NO_CACHE_DELAY configuration parameter?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (MYFACES-3575) Disable relative location caching in DefaultFaceletFactory

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

Leonardo Uribe commented on MYFACES-3575:
-----------------------------------------

I have been thinking about this problem and the intention of _relativeLocations is prevent unnecessary calls to ExternalContext.getResource(). In theory a cache like this one should be inside ResourceResolver implementation, because that's the right location to do that caching. Also, that part is done there to prevent unnecessary URL parsing.

The real problem is the whole hack proposed violates Partial State Saving (PSS) requeriments, because it allows to change the location of the templates for a given string pointing to a template. So, if there is a postback and something has changed the algorithm will fail.




                
> Disable relative location caching in DefaultFaceletFactory
> ----------------------------------------------------------
>
>                 Key: MYFACES-3575
>                 URL: https://issues.apache.org/jira/browse/MYFACES-3575
>             Project: MyFaces Core
>          Issue Type: Improvement
>          Components: Extension Feature
>    Affects Versions: 2.0.14, 2.1.8
>         Environment: Linux
>            Reporter: Dmitry Kukushkin
>            Assignee: Leonardo Uribe
>            Priority: Minor
>
> In some circumstances the caching of the relative location in the public Facelet getFacelet(String uri) in DefaultFaceletFactory is not desirable: e.g. return the mobile and full content version for the same URI, if the user changes the content type on the fly. Now this caching always causes the same content to be returned.
> Should it be possible to switch it off like it is done for other caches in this class with needsToBeRefreshed check and NO_CACHE_DELAY configuration parameter?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (MYFACES-3575) Disable relative location caching in DefaultFaceletFactory

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

Dmitry Kukushkin commented on MYFACES-3575:
-------------------------------------------

Is it not just making this _relativeLocations expiring, as it is done for _compositeComponentMetadataFacelets in the DefaultFaceletFactory class? This IMO will be more consistent instead.
                
> Disable relative location caching in DefaultFaceletFactory
> ----------------------------------------------------------
>
>                 Key: MYFACES-3575
>                 URL: https://issues.apache.org/jira/browse/MYFACES-3575
>             Project: MyFaces Core
>          Issue Type: Improvement
>          Components: Extension Feature
>    Affects Versions: 2.0.14, 2.1.8
>         Environment: Linux
>            Reporter: Dmitry Kukushkin
>            Assignee: Leonardo Uribe
>            Priority: Minor
>
> In some circumstances the caching of the relative location in the public Facelet getFacelet(String uri) in DefaultFaceletFactory is not desirable: e.g. return the mobile and full content version for the same URI, if the user changes the content type on the fly. Now this caching always causes the same content to be returned.
> Should it be possible to switch it off like it is done for other caches in this class with needsToBeRefreshed check and NO_CACHE_DELAY configuration parameter?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (MYFACES-3575) Disable relative location caching in DefaultFaceletFactory

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

Leonardo Uribe commented on MYFACES-3575:
-----------------------------------------

In JSF 2.1 you can provide your custom FaceletCacheFactory and override that part. Since JSF 2.0 and 2.1 has few changes, there is no need to do something in JSF 2.0 branch, just try with 2.1 jars.
                
> Disable relative location caching in DefaultFaceletFactory
> ----------------------------------------------------------
>
>                 Key: MYFACES-3575
>                 URL: https://issues.apache.org/jira/browse/MYFACES-3575
>             Project: MyFaces Core
>          Issue Type: Improvement
>          Components: Extension Feature
>    Affects Versions: 2.0.14
>         Environment: Linux
>            Reporter: Dmitry Kukushkin
>            Priority: Minor
>
> In some circumstances the caching of the relative location in the public Facelet getFacelet(String uri) in DefaultFaceletFactory is not desirable: e.g. return the mobile and full content version for the same URI, if the user changes the content type on the fly. Now this caching always causes the same content to be returned.
> Should it be possible to switch it off like it is done for other caches in this class with needsToBeRefreshed check and NO_CACHE_DELAY configuration parameter?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (MYFACES-3575) Disable relative location caching in DefaultFaceletFactory

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

Dmitry Kukushkin commented on MYFACES-3575:
-------------------------------------------

This is what I meant, why not to make _relativeLocations cache also expiring, like it is done for _compositeComponentMetadataFacelets?
                
> Disable relative location caching in DefaultFaceletFactory
> ----------------------------------------------------------
>
>                 Key: MYFACES-3575
>                 URL: https://issues.apache.org/jira/browse/MYFACES-3575
>             Project: MyFaces Core
>          Issue Type: Improvement
>          Components: Extension Feature
>    Affects Versions: 2.0.14, 2.1.8
>         Environment: Linux
>            Reporter: Dmitry Kukushkin
>            Assignee: Leonardo Uribe
>            Priority: Minor
>
> In some circumstances the caching of the relative location in the public Facelet getFacelet(String uri) in DefaultFaceletFactory is not desirable: e.g. return the mobile and full content version for the same URI, if the user changes the content type on the fly. Now this caching always causes the same content to be returned.
> Should it be possible to switch it off like it is done for other caches in this class with needsToBeRefreshed check and NO_CACHE_DELAY configuration parameter?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (MYFACES-3575) Disable relative location caching in DefaultFaceletFactory

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

Leonardo Uribe commented on MYFACES-3575:
-----------------------------------------

They are two different things. I finally can see the problem, it could be good to have a logic here, but it should be solved at spec level. 
                
> Disable relative location caching in DefaultFaceletFactory
> ----------------------------------------------------------
>
>                 Key: MYFACES-3575
>                 URL: https://issues.apache.org/jira/browse/MYFACES-3575
>             Project: MyFaces Core
>          Issue Type: Improvement
>          Components: Extension Feature
>    Affects Versions: 2.0.14, 2.1.8
>         Environment: Linux
>            Reporter: Dmitry Kukushkin
>            Assignee: Leonardo Uribe
>            Priority: Minor
>
> In some circumstances the caching of the relative location in the public Facelet getFacelet(String uri) in DefaultFaceletFactory is not desirable: e.g. return the mobile and full content version for the same URI, if the user changes the content type on the fly. Now this caching always causes the same content to be returned.
> Should it be possible to switch it off like it is done for other caches in this class with needsToBeRefreshed check and NO_CACHE_DELAY configuration parameter?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira