When you create servlets
you do not directly access the classes.
There are two ways of defining the servlet mappings either through annotations
, or through web.xml
.
Through Annotation
Servlets using the 3.0 specification have a annotation that specifies the servlet-mapping… you should check this to see which URLs are mapped to your class/servlet.
Have a look at: http://www.softwareengineeringsolutions.com/blogs/2010/07/31/annotation-processing-in-servlet-specification-3-0/
You should have a line starting with @WebServlet
, for example:
@WebServlet(name="HelloWorldServlet", urlPatterns={"/foo", "/bar"})
In the example above, the servlet doGet
and doPost
methods are executed when the URLs serverName:Port/foo
and serverName:Port/bar
are accessed either by PUT or GET.
Through Web.xml
If your using the older specifications, you need to check the web.xml
file that has the mapping in XML format.
See: http://docs.oracle.com/cd/E13222_01/wls/docs92/webapp/configureservlet.html
<servlet>
<servlet-name>watermelon</servlet-name>
<servlet-class>myservlets.watermelon</servlet-class>
</servlet>