Loom requires a filter to handle action requests:
<?xml version="1.0" encoding="UTF-8"?>
<web-app
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd
"
metadata-complete="true"
version="2.5">
<display-name>Loom Demo App</display-name>
<filter>
<filter-name>LoomFilter</filter-name>
<filter-class>org.loom.filter.LoomFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>LoomFilter</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>REQUEST</dispatcher>
</filter-mapping>
</web-app>
The simplest way to create a working configuration file is using the scaffolding tool.
<loom:config development="true">
<loom:action-scan base-package="com.acme.action,org.loom.action.support"/>
<loom:messages defaultLocale="en" />
<!--
The browser resource bundles (CSS or javascript)
-->
<loom:web-resources>
<loom:web-resource name="css">
/css/yui/reset.css
/css/yui/base.css
/css/styles.css
</loom:web-resource>
<loom:web-resource name="myapp">
classpath:js/prototype/prototype.js
classpath:js/loom/core/core.js
classpath:js/loom/core/format.js
classpath:js/loom/ui/ui.js
/js/myfile.js
</loom:web-resource>
</loom:web-resources>
</loom:config>
<!--
Register interceptors and annotation-processors
-->
<context:component-scan base-package="org.loom.persistence,org.loom.interceptor,org.loom.annotation" />
This example will search for actions inside com.acme.action and org.loom.action.support. Any class inside these packages that is not abstract and implements the Action interface will be registered automatically.
The example also includes a webResourceBundleRepository configured to serve some css and js files.
The Config.development attribute controls the behavior of: