title: how to create War file for a RESTful web service developed in eclipse IDE
body: <p>I ve created a sample REST web service which writes some data in a xml file. Now I have hard coded the path where the xml file is to be written. I want to know how to declare that local path of the file in web.xml file as servlet parameter and how to get the path from there and use it in codebe . Also I need to create the WAR file for the service which needs to deployed in tomcat. This war file should take that parameter from the web.xml file. I used eclipse IDE to develop the web service. Can anyone tell me how to do the above things ?</p>
  
  <p>Here I have attached the servlet code present inside the web.xml file.</p>
  
  <pre><code>&lt;servlet&gt;
    &lt;servlet-name&gt;Jersey REST Service&lt;/servlet-name&gt;
  &lt;servlet-class&gt;
    com.sun.jersey.spi.container.servlet.ServletContainer
  &lt;/servlet-class&gt;
  &lt;init-param&gt;
      &lt;param-name&gt;com.sun.jersey.config.property.packages&lt;/param-name&gt;
      &lt;param-value&gt;com.sample.service&lt;/param-value&gt;
    &lt;/init-param&gt;
    &lt;init-param&gt;
      &lt;param-name&gt;filepath&lt;/param-name&gt;
      &lt;param-value&gt;filepath value&lt;/param-value&gt;
    &lt;/init-param&gt;
    &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
  &lt;/servlet&gt;
  &lt;servlet-mapping&gt;
    &lt;servlet-name&gt;Jersey REST Service&lt;/servlet-name&gt;
    &lt;url-pattern&gt;/api/*&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  </code></pre>
  
  <p>com.sample.service is the package where I have my Rest web service class.</p>