You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@tiles.apache.org by "Konrad Garus (Created) (JIRA)" <ji...@apache.org> on 2012/02/14 11:53:59 UTC

[jira] [Created] (TILES-541) VelocityAttributeRenderer does not pass context attributes

VelocityAttributeRenderer does not pass context attributes
----------------------------------------------------------

                 Key: TILES-541
                 URL: https://issues.apache.org/jira/browse/TILES-541
             Project: Tiles
          Issue Type: Bug
          Components: tiles-velocity
    Affects Versions: 2.2.2
            Reporter: Konrad Garus


VelocityTilesRequestContextFactory creates VelocityTilesRequestContext which still holds the velocity Context passed from outside.

However, VelocityAttributeRenderer ignores this VelocityTilesRequestContext completely and creates a new context with velocityView.createContext(request, response).

As a result the context map that is passed to Tiles from outside is not passed along to Velocity. Among other things, it is causing issues with integration of Spring, Tiles and Velocity.

--
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] (TILES-541) VelocityAttributeRenderer does not pass context attributes

Posted by "Nicolas Le Bas (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TILES-541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13295780#comment-13295780 ] 

Nicolas Le Bas commented on TILES-541:
--------------------------------------

Thanks for this detailed description of your solution. But I still don't clearly understand the problem it solves.

My guess:
- if you use spring's VelocityViewResolver, you can access the velocity toolbox but not Tiles' taglib.
- if you use spring's TilesViewResolver, you can access Tiles' taglib but not the velocity toolbox.

About your solution:
I'm not sure about forwarding the velocity context this way, I don't want to expose the "local" variables (#set) to the included pages. It seems dangerous, for instance an included page might change the value of the caller's variable. At the very least, you should wrap the caller's context in a new velocity Context.
                
> VelocityAttributeRenderer does not pass context attributes
> ----------------------------------------------------------
>
>                 Key: TILES-541
>                 URL: https://issues.apache.org/jira/browse/TILES-541
>             Project: Tiles
>          Issue Type: Bug
>          Components: tiles-velocity
>    Affects Versions: 2.2.2
>            Reporter: Konrad Garus
>            Assignee: Nicolas Le Bas
>
> VelocityTilesRequestContextFactory creates VelocityTilesRequestContext which still holds the velocity Context passed from outside.
> However, VelocityAttributeRenderer ignores this VelocityTilesRequestContext completely and creates a new context with velocityView.createContext(request, response).
> As a result the context map that is passed to Tiles from outside is not passed along to Velocity. Among other things, it is causing issues with integration of Spring, Tiles and Velocity.

--
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] [Assigned] (TILES-541) VelocityAttributeRenderer does not pass context attributes

Posted by "Nicolas Le Bas (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TILES-541?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Nicolas Le Bas reassigned TILES-541:
------------------------------------

    Assignee: Nicolas Le Bas
    
> VelocityAttributeRenderer does not pass context attributes
> ----------------------------------------------------------
>
>                 Key: TILES-541
>                 URL: https://issues.apache.org/jira/browse/TILES-541
>             Project: Tiles
>          Issue Type: Bug
>          Components: tiles-velocity
>    Affects Versions: 2.2.2
>            Reporter: Konrad Garus
>            Assignee: Nicolas Le Bas
>
> VelocityTilesRequestContextFactory creates VelocityTilesRequestContext which still holds the velocity Context passed from outside.
> However, VelocityAttributeRenderer ignores this VelocityTilesRequestContext completely and creates a new context with velocityView.createContext(request, response).
> As a result the context map that is passed to Tiles from outside is not passed along to Velocity. Among other things, it is causing issues with integration of Spring, Tiles and Velocity.

--
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] (TILES-541) VelocityAttributeRenderer does not pass context attributes

Posted by "Konrad Garus (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TILES-541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13207631#comment-13207631 ] 

Konrad Garus commented on TILES-541:
------------------------------------

If this bug is confirmed and you are interested in a patch, I could create one.
                
> VelocityAttributeRenderer does not pass context attributes
> ----------------------------------------------------------
>
>                 Key: TILES-541
>                 URL: https://issues.apache.org/jira/browse/TILES-541
>             Project: Tiles
>          Issue Type: Bug
>          Components: tiles-velocity
>    Affects Versions: 2.2.2
>            Reporter: Konrad Garus
>
> VelocityTilesRequestContextFactory creates VelocityTilesRequestContext which still holds the velocity Context passed from outside.
> However, VelocityAttributeRenderer ignores this VelocityTilesRequestContext completely and creates a new context with velocityView.createContext(request, response).
> As a result the context map that is passed to Tiles from outside is not passed along to Velocity. Among other things, it is causing issues with integration of Spring, Tiles and Velocity.

--
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] (TILES-541) VelocityAttributeRenderer does not pass context attributes

Posted by "Konrad Garus (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TILES-541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13295552#comment-13295552 ] 

Konrad Garus commented on TILES-541:
------------------------------------

Perhaps this will shed some light. Actually, the workaround in this post could be used for the patch: http://squirrel.pl/blog/2012/02/20/spring-velocity-tile/
                
> VelocityAttributeRenderer does not pass context attributes
> ----------------------------------------------------------
>
>                 Key: TILES-541
>                 URL: https://issues.apache.org/jira/browse/TILES-541
>             Project: Tiles
>          Issue Type: Bug
>          Components: tiles-velocity
>    Affects Versions: 2.2.2
>            Reporter: Konrad Garus
>            Assignee: Nicolas Le Bas
>
> VelocityTilesRequestContextFactory creates VelocityTilesRequestContext which still holds the velocity Context passed from outside.
> However, VelocityAttributeRenderer ignores this VelocityTilesRequestContext completely and creates a new context with velocityView.createContext(request, response).
> As a result the context map that is passed to Tiles from outside is not passed along to Velocity. Among other things, it is causing issues with integration of Spring, Tiles and Velocity.

--
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] (TILES-541) VelocityAttributeRenderer does not pass context attributes

Posted by "Nicolas Le Bas (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TILES-541?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13295316#comment-13295316 ] 

Nicolas Le Bas commented on TILES-541:
--------------------------------------

We'll be rewriting the VelocityAttributeRenderer for Tiles 3.1, in order to make it usable without servlets (see 
[TREQ-13|https://issues.apache.org/jira/browse/TREQ-13]. Using VelocityEngine instead of VelocityView may also help 
the integration with Spring.

I'm not sure I understand the details of the problem you describe, especially the issues you're referering to. A patch may not help that much, however I'm interested in a test case.
                
> VelocityAttributeRenderer does not pass context attributes
> ----------------------------------------------------------
>
>                 Key: TILES-541
>                 URL: https://issues.apache.org/jira/browse/TILES-541
>             Project: Tiles
>          Issue Type: Bug
>          Components: tiles-velocity
>    Affects Versions: 2.2.2
>            Reporter: Konrad Garus
>            Assignee: Nicolas Le Bas
>
> VelocityTilesRequestContextFactory creates VelocityTilesRequestContext which still holds the velocity Context passed from outside.
> However, VelocityAttributeRenderer ignores this VelocityTilesRequestContext completely and creates a new context with velocityView.createContext(request, response).
> As a result the context map that is passed to Tiles from outside is not passed along to Velocity. Among other things, it is causing issues with integration of Spring, Tiles and Velocity.

--
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