Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <blockquote> <p><em>I've read there is no need to mention the servlet in web.xml.</em></p> </blockquote> <p>You're probably confusing with the legacy Tomcat-builtin <a href="http://tomcat.apache.org/tomcat-4.1-doc/catalina/funcspecs/fs-invoker.html" rel="nofollow noreferrer"><code>InvokerServlet</code></a> which was present in older versions of Apache Tomcat (and still mentioned in poor and outdated tutorials/books). It indeed allowed to invoke servlets like that without the need to map anything. However, it was later confirmed that it was a <a href="http://wiki.apache.org/tomcat/FAQ/Miscellaneous#Q3" rel="nofollow noreferrer">security hole and vulrenable to attacks</a>. It was disabled and deprecated on Tomcat 5.0 and removed on Tomcat 7.0. In such case, you really need to map your servlet in <code>web.xml</code> (and put it in a package!).</p> <p>Another source of confusion may be the new Servlet 3.0 <a href="http://download.oracle.com/javaee/6/api/javax/servlet/annotation/WebServlet.html" rel="nofollow noreferrer"><code>@WebServlet</code></a> annotation. When you're already using a Servlet 3.0 container like Tomcat 7.0, then you could use this annotation to map the servlet without the need to fiddle with <code>web.xml</code>.</p> <pre><code>package com.example; @WebServlet("/MyServlet") public class MyServlet extends HttpServlet { // ... } </code></pre> <p>Then you'll be able to access it the way you want.</p> <h3>See also:</h3> <ul> <li><a href="https://stackoverflow.com/tags/servlets/info">Our Servlets wiki page</a></li> </ul>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload