3. Using Virgo Snaps in your application
Prev |  | Next

## 3. Using Virgo Snaps in your application

Every Snap or host should also be a regular WAB (Web Application Bundle), all you have to do is add some additional configuration to benefit from VS.

## 3.1 Configuring the host

In the WAB that is to act as a host to Snaps bundles, all that needs to be added is a filter in the hosts ' `web.xml`'. This filter can be mapped to any sub path that you want forwarded to registered Snaps. It is important to note the extra `dispatcher` declarations in the `filter-mapping`. Without these internal lookups for resources like JSPs won't get passed to the appropriate Snap when needed.

    <filter>
        <filter-name>host-filter</filter-name>
        <filter-class>org.eclipse.virgo.snaps.core.SnapHostFilter</filter-class>
    </filter>

    <filter-mapping>
        <filter-name>host-filter</filter-name>
        <url-pattern>/*</url-pattern>
        <dispatcher>INCLUDE</dispatcher>
        <dispatcher>FORWARD</dispatcher>
        <dispatcher>REQUEST</dispatcher>
    </filter-mapping>

Prev |  | Next
2.2 Verifying it's working | Home | 3.2 Configuring a Snap