Access to Services

When developing templates or scripts only a small list of services are available to use. You can expose other services with the following steps.

Site Services

If your site includes a custom application context with services, you can make them available by updating the site configuration:

<site>
  <publicBeans>
    <bean>userService</bean> <!-- Indicate a specific bean name -->
    <bean>blog.+</bean>      <!-- Indicate a pattern for the bean name -->
  </publicBeans>
</site>

System Services

Warning

This setting will apply to all sites

System objects can’t be exposed by adding them to a list, instead you will need to change the following configuration:

# Expose all system services
crafter.engine.disableVariableRestrictions=true