title: How do I set Jasper init parameters globally for all servlets in Tomcat's web.xml?
body: <p>I'm using <a href="http://tomcat.apache.org/tomcat-7.0-doc/jasper-howto.html" rel="nofollow">Tomcat's Jasper HowTo</a> to set init parameters for my servlets.  But I haven't figured out how to set these parameters globally in the web.xml file.  How do I avoid duplicating my init-params in every servlet description? </p>
  
  <pre><code>&lt;web-app version="3.0" 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_3_0.xsd"
           metadata-complete="true"&gt;
  
      &lt;servlet&gt;
          &lt;servlet-name&gt;foo&lt;/servlet-name&gt;
          &lt;jsp-file&gt;/WEB-INF/foo/foo.jsp&lt;/jsp-file&gt;
          &lt;init-param&gt;
              &lt;param-name&gt;compilerTargetVM&lt;/param-name&gt;
              &lt;param-value&gt;1.7&lt;/param-value&gt;
          &lt;/init-param&gt;
      &lt;/servlet&gt;
  
      &lt;servlet&gt;
          &lt;servlet-name&gt;bar&lt;/servlet-name&gt;
          &lt;jsp-file&gt;/WEB-INF/bar/bar.jsp&lt;/jsp-file&gt;
          &lt;init-param&gt;
              &lt;param-name&gt;compilerTargetVM&lt;/param-name&gt;
              &lt;param-value&gt;1.7&lt;/param-value&gt;
          &lt;/init-param&gt;
      &lt;/servlet&gt;
  
  &lt;/web-app&gt;
  </code></pre>