title: How to remove .py from urls for pyservlet using jython
body: <p>I'm looking at the jython servlet tutorial and have got everything working. How do I make the url be</p>
  
  <p>localhost:8080/jythondemo/JythonServlet1</p>
  
  <p>instead of</p>
  
  <p>localhost:8080/jythondemo/JythonServlet1.py</p>
  
  <p><a href="http://seanmcgrath.blogspot.com/JythonWebAppTutorialPart1.html" rel="nofollow">http://seanmcgrath.blogspot.com/JythonWebAppTutorialPart1.html</a></p>
  
  <p>Here is the relevant part from web.xml</p>
  
  <pre><code>&lt;web-app&gt;      
      &lt;servlet&gt;
          &lt;servlet-name&gt;ServletTest&lt;/servlet-name&gt;
          &lt;servlet-class&gt;ServletTest&lt;/servlet-class&gt;
      &lt;/servlet&gt;
      &lt;servlet&gt;
          &lt;servlet-name&gt;PyServlet&lt;/servlet-name&gt;
          &lt;servlet-class&gt;org.python.util.PyServlet&lt;/servlet-class&gt;
          &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
      &lt;/servlet&gt;
  
      &lt;servlet-mapping&gt;
          &lt;servlet-name&gt;ServletTest&lt;/servlet-name&gt;
          &lt;url-pattern&gt;/ServletTest&lt;/url-pattern&gt;
      &lt;/servlet-mapping&gt;
  
      &lt;servlet-mapping&gt;
          &lt;servlet-name&gt;PyServlet&lt;/servlet-name&gt;
          &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
      &lt;/servlet-mapping&gt;
  &lt;/web-app&gt;
  </code></pre>
  
  <p>I've also tried with</p>
  
  <pre><code>&lt;servlet-mapping&gt;
      &lt;servlet-name&gt;PyServlet&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  </code></pre>
  
  <p>It seems with the above changes pyservlet is getting the url JythonServlet1 but it does not know what to do with it. Here is the error message:</p>
  
  <pre><code>javax.servlet.ServletException: I can't guess the name of the class from /.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/testjython3/JythonServlet1
  org.python.util.PyServlet.createInstance(PyServlet.java:202)
  org.python.util.PyServlet.loadServlet(PyServlet.java:188)
  org.python.util.PyServlet.getServlet(PyServlet.java:178)
  org.python.util.PyServlet.service(PyServlet.java:155)
  </code></pre>