...
For more information on Velocity itself, please visit the Velocity website.
Info |
---|
Velocity is similar to FreeMarker, as both are template languages that can be used outside of a Servlet container. The framework uses FreeMarker internally since it has better error reporting. Developers may also like that FreeMarker supports JSP taglibs. However, both are good alternatives to JSP. |
...
Getting started with Velocity is as simple as ensuring all the dependencies are included in your project's classpath. Other than that, struts-default.xml already configures the Velocity Result.
...
Since the action context is resolved after the value stack, you can reference the variable without the typical preceding marker (#) that has to be used with the JSP s:property
tag. Omitting the marker can be convenient, but it can also trip you up, if used carelessly.
Code Block | ||||
---|---|---|---|---|
| ||||
#s-url#surl "id=url" "value=http://www.yahoo.com" Click <a href="${url}">here</a>! |
...
You can configure Velocity by placing configuration items in velocity.properties.