Results 1 to 2 of 2
  1. #1
    xhunter is offline Member
    Join Date
    Feb 2011
    Posts
    1
    Rep Power
    0

    Default Trying to create a simple web app

    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

    Here is my web.xml:

    Java Code:
    <?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!

  2. #2
    BlueCow is offline Member
    Join Date
    Feb 2011
    Posts
    2
    Rep Power
    0

Similar Threads

  1. How do you create a simple timer?
    By Arnold in forum New To Java
    Replies: 2
    Last Post: 11-01-2009, 04:53 PM
  2. Static Builder and Create Methods for simple class
    By Pilot Ace in forum New To Java
    Replies: 3
    Last Post: 08-30-2009, 10:18 AM
  3. dont let me create simple class
    By itaipee in forum New To Java
    Replies: 5
    Last Post: 01-11-2009, 11:07 AM
  4. How Can I Create a Simple Grid with a GridLayout?
    By geeeeky.girl in forum AWT / Swing
    Replies: 7
    Last Post: 01-07-2009, 03:31 AM
  5. How to create a simple deadlock
    By Java Tip in forum java.lang
    Replies: 0
    Last Post: 04-09-2008, 06:36 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •