History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: WW-1128
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Minor Minor
Assignee: Andres March
Reporter: Jess Balint
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
WebWork

Sitemesh Velocity Integration renders uneval'd templates

Created: 26/Jan/06 09:51 AM   Updated: 03/Feb/06 12:01 PM
Component/s: Misc
Affects Version/s: 2.2, 2.2.1
Fix Version/s: 2.2.1

Environment: Windows Server 2003, JDK 1.5, Resin 3.0.14, WebWork 2.2 & CVS HEAD, SiteMesh 2.2.1.


 Description  « Hide
I am using the exact SiteMesh/Velocity configuration shown in the wiki:

http://www.opensymphony.com/webwork/wikidocs/Sitemesh.html

When a page is rendered, I only get the literal template and it's not evaluated by Velocity.


 All   Comments   Change History      Sort Order:
Andres March - [26/Jan/06 10:45 AM ]
Could you please post an example of your template? Did you look at the shopping cart example? Does it work for you? If so, how is your site different?

Jess Balint - [26/Jan/06 10:50 AM ]
The shopping cart doesn't use Velocity decorators. The template I am trying to use for the decorator is something very simple like:

<html><head>#wwhead() <title>$title</title> <head>
<body>$body</body></html>

Andres March - [27/Jan/06 12:38 AM ]
Sorry, saw the velocity.properties in the example and just assumed it had one. I'll have a look.

Andres March - [27/Jan/06 02:38 AM ]
This is a simple issue. We might even just want to change the docs to match the code. You need to prefix your regular sitemesh references in velocity with page. $page is the only thing being put into the context. So use $page.body instead of $body. This goes against convention but is more flexible than putting each page property in the context. We should probably do both, so you could use either $page.body or $body. But for now you have a workaround and not a bad one at that.

Jess Balint - [27/Jan/06 09:01 AM ]
This works well indeed. Many thanks.

Rainer Hermanns - [31/Jan/06 05:39 PM ]
Andres, can this be closed?

Andres March - [31/Jan/06 06:14 PM ]
well, either the docs or code should be updated to match. I think the site mesh docs say $body etc.., so we should probably expose those things in the context directly. I'm not sure if there is an easier way with the OGNL stack but I was just going to add each of the sitemesh objs to the context. What I don't like is that this needs to be maintained. Or we could just point out in our docs that the sitemesh objs should be referenced like $page.body etc.... What do you think?

Rainer Hermanns - [02/Feb/06 02:55 PM ]
I think the latter would be good.
So there will be no need to maintain the code..
Can you takeover this documentation task to sitemesh, so that we can close the issue here?

Thanks,
Rainer