title: Configuring Shiro with Guice without a ServletContext
body: <p>I'm using <i>Guice</i> to wire a <i>Jetty</i> server and I want to add some security with <i>Apache Shiro</i>.</p>
  
  <p>It seems Shiro needs a <i>ServletContext</i> to be configured, but the problem is I don;t have a ServletContext at the configuration time (for example in a <i>ServletModule</i> as the documentation states). The <i>ServletContext</i> is available in <i>GuiceServletContextListener</i>, but at this time, my injector is already created so it's to late to install the <i>Shiro</i> module.</p>
  
  <p>I tried to provide the <i>ServletContext</i> to <i>Shiro</i> through a <i>Guice</i> provider, (<i>Provider&lt;ServletContext&gt;</i>) but still without success. I thought this provider will serve the ServletContext after its creation. This also gives a WARNING:</p>
  
  <pre><code>"com.google.inject.servlet.InternalServletModule$BackwardsCompatibleServletContextProvider get
  WARNING: You are attempting to use a deprecated API (specifically, attempting to @Inject ServletContext inside an eagerly created singleton. While we allow this for backwards compatibility, be warned that this MAY have unexpected behavior if you have more than one injector (with ServletModule) running in the same JVM."
  </code></pre>
  
  <p>How could one install the Shiro Web module after the injector is created?</p>