title: Difference between servlet/servlet-mapping and filter/filter-mapping?
body: <p>As part of exploring/learning Struts2, JSP and Servlets, I see from <a href="http://code.google.com/appengine/docs/java/config/webxml.html" rel="nofollow noreferrer">here</a> and <a href="http://www.vaannila.com/struts-2/struts-2-example/struts-2-hello-world-example-1.html" rel="nofollow noreferrer">there</a> that <code>servlets</code> and <code>servlets-mapping</code> can be used in <code>web.xml</code>. However, Struts2 mentions <code>filters</code> and <code>filter-mapping</code> too for <code>web.xml</code>.</p>
  <p>What is the difference between both? Are these mutually exclusive? When should I use which and why? Can someone clarify the concepts? Thanks.</p>
  <p><strong>CLARIFICATION</strong></p>
  <p>I just got to understand that I needed to understand how Struts2 and Servlets are related: <a href="http://www.coderanch.com/t/57899/Struts/Difference-between-servlet-struts" rel="nofollow noreferrer">http://www.coderanch.com/t/57899/Struts/Difference-between-servlet-struts</a></p>