Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set up the root servlet in Tomcat 6? [duplicate]

Sorry for beginner's questions but I wonder how can I set the root servlet in Tomcat 6? For example I want to access my servlet on

localhost:8080, not on

localhost:8080/myservlet

Thanks!

like image 600
gennad Avatar asked Nov 14 '10 10:11

gennad


People also ask

Where is the root directory in Tomcat?

Simply put, web applications are placed under $CATALINA_HOME\webapps, where $CATALINA_HOME is the Tomcat's installation directory.

What is default servlet in Tomcat?

The default servlet is the servlet which serves static resources as well as serves the directory listings (if directory listings are enabled).

What is use of @servlet annotation?

This annotation is used within the ServletSecurity annotation to represent security constraints on specific HTTP protocol messages. Annotation that may be specified on a Servlet class, indicating that instances of the Servlet expect requests that conform to the multipart/form-data MIME type.


1 Answers

deploy an web app with context root /
and set servlet-mapping in web.xml as

<servlet-mapping>
  ..
  <url-pattern>/</url-pattern>
</servlet-mapping>  
like image 93
jmj Avatar answered Sep 20 '22 01:09

jmj