Hi, I'm trying to create a web application with a servlet but I couldn't get it to load to index.jsp. Can anyone tell me what I'm doing wrong? I'm pretty sure I already have the correct directory structure, with both index.jsp and web.xml directly under webapp/WEB-INF. I can access the servlet just fine by going to http://localhost:8080/MyApp/TestServlet, but my index.jsp doesn't load when I go to http://localhost:8080/MyApp. If it matters any, I'm using Eclipse Helios and Tomcat 6.0 as a plugin
Here is my web.xml:
<?xml version="1.0"?> <web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" version="2.5"> <servlet> <servlet-name>TestServlet</servlet-name> <servlet-class>com.myapp.servlet.TestServlet</servlet-class> </servlet> <servlet-mapping> <servlet-name>TestServlet</servlet-name> <url-pattern>/TestServlet</url-pattern> </servlet-mapping> <welcome-file-list> <welcome-file>index.jsp</welcome-file> </welcome-file-list> </web-app>
Thanks in advance!