Template dispatchers allow different presentation technologies to be used for composing pages that define the look and feel of your blog. The dispatcher handles loading of page templates and making available certain objects for you to use in your templates. blojsom's default installation comes with two different dispatchers, one for using JavaServer Pages (JSP)
and one for using Velocity
.
Configuring Dispatchers
Dispatchers are configured and referenced according to template suffix in the /WEB-INF/classes/blojsom.xml file. Accordingly, the bean ID for dispatchers must correspond to the suffix for templates that are to be served by a particular dispatcher. For example, in the following case, vm will serve Velocity templates:
<bean id="vm" class="org.blojsom.dispatcher.velocity.VelocityDispatcher" init-method="init">
<property name="velocityProperties">
<ref bean="defaultVelocityProperties"/>
</property>
<property name="blojsomProperties">
<ref bean="defaultProperties"/>
</property>
<property name="servletConfig">
<ref bean="servletConfigFactoryBean"/>
</property>
</bean>
Available Dispatchers
The following template dispatchers are included with blojsom.
| Dispatcher |
Description |
| JSP Dispatcher |
Allows you to use JSP to define page templates for your blog. |
| Velocity Dispatcher |
Allows you to use Velocity to define page templates for your blog. |
The following template dispatchers are included with the blojsom add-on bundle.
| Freemarker Dispatcher |
Freemarker is an alternative to Velocity and this dispatcher allows you to use Freemarker to define page templates for your blog. |
| Groovy Dispatcher |
Groovy is an an agile dynamic language for Java and has a simple template engine that allows you to intermix Groovy when defining page templates for your blog. |
| WebMacro Dispatcher |
Allows you to use WebMacro to define page templates for your blog. |
| BSF Dispatcher |
Allows you to integrate multiple scripting languages using the Bean Scripting Framework to write templates for your blog. |