3.4 Referencing resources
Prev | 3. Using Virgo Snaps in your application | Next

## 3.4 Referencing resources

If the Snap needs to lookup any resources, this can be done in the normal way and if the resource cannot be found in the Snap, then the host will be checked. Remember that a host and all its Snaps use a single `ServletContext`. As the Snap is always checked first it can hide resources at the same path in its host. So if you want to look up a resource in the Snaps host that exists in the Snap simply prefix the path with `host:`. This will then cause the Snaps system to bypass the Snap and look only in its host for the requested resource. If it is not found in its host the Snap will NOT be checked, the lookup will simple return with nothing.

    request.getServletContext().getResource("host:/WEB-INF/sample.properties");

This is a line of Java code that gets the ServletContext from the HttpRequest object and then tries to get a resource from the host, bypassing the Snap.

Prev | Up | Next
3.3 Using the snaps taglibs | Home | 4. A Sample Application