How to set up the root servlet in Tomcat 6? [duplicate]
问题 This question already has answers here : How can I map a “root” Servlet so that other scripts are still runnable? (8 answers) Closed 2 years ago . 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! 回答1: deploy an web app with context root / and set servlet-mapping in web.xml as <servlet-mapping> .. <url-pattern>/</url-pattern> </servlet-mapping> 回答2: This is