| <html><head> |
| <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> |
| <title>3. Using Virgo Snaps in your application</title><link rel="stylesheet" href="css/stylesheet.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.74.0"><link rel="home" href="index.html" title="Virgo Snaps User Guide"><link rel="up" href="index.html" title="Virgo Snaps User Guide"><link rel="prev" href="ch02s02.html" title="2.2 Verifying it's working"><link rel="next" href="ch03s02.html" title="3.2 Configuring a Snap"><!--Begin Google Analytics code--><script type="text/javascript"> |
| var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); |
| document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); |
| </script><script type="text/javascript"> |
| var pageTracker = _gat._getTracker("UA-2728886-3"); |
| pageTracker._setDomainName("none"); |
| pageTracker._setAllowLinker(true); |
| pageTracker._trackPageview(); |
| </script><!--End Google Analytics code--></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">3. Using Virgo Snaps in your application</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch02s02.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="ch03s02.html">Next</a></td></tr></table><hr></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="using-snaps"></a>3. Using Virgo Snaps in your application</h2></div></div></div><p> |
| 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. |
| </p><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="using-snaps-configuring-the-host"></a>3.1 Configuring the Host</h2></div></div></div><p> |
| 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 ' |
| <code class="literal">web.xml</code>'. This filter can be mapped to any sub path that you want forwarded to registered |
| snaps. It is important to note the extra <code class="literal">dispatcher</code> declarations in the <code class="literal">filter-mapping</code>. |
| Without these internal lookups, resources like JSPs won't get passed to the appropriate snap when needed. |
| </p><pre class="programlisting"> |
| <filter> |
| <filter-name>host-filter-name</filter-name> |
| <filter-class>org.eclipse.virgo.snaps.core.SnapHostFilter</filter-class> |
| </filter> |
| |
| <filter-mapping> |
| <filter-name>host-filter-name</filter-name> |
| <url-pattern>/*</url-pattern> |
| <dispatcher>INCLUDE</dispatcher> |
| <dispatcher>FORWARD</dispatcher> |
| <dispatcher>REQUEST</dispatcher> |
| </filter-mapping> |
| </pre></div></div><!--Begin LoopFuse code--><script src="http://loopfuse.net/webrecorder/js/listen.js" type="text/javascript"></script><script type="text/javascript"> |
| _lf_cid = "LF_48be82fa"; |
| _lf_remora(); |
| </script><!--End LoopFuse code--><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch02s02.html">Prev</a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="ch03s02.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">2.2 Verifying it's working </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 3.2 Configuring a Snap</td></tr></table></div></body></html> |