I'm using Apache Tomcat 6.0.14 with Java 1.6.0_02.
I've been having some trouble loading servlets, so I tried a basic HelloWorld type program just to make sure everything was okay and it can't find the servlet-api.jar.
Isn't it supposed to automatically load all of the jar files in $CATALINA_HOME/lib?
Here's my code:
Here's my web.xml:
Thank you,
--
-- Ghodmode
Give a man a fish and he'll come back to buy more... Teach a man to fish and you're out of business.
I've been having some trouble loading servlets, so I tried a basic HelloWorld type program just to make sure everything was okay and it can't find the servlet-api.jar.
Isn't it supposed to automatically load all of the jar files in $CATALINA_HOME/lib?
Here's my code:
Code:
import javax.servlet.http.*;
import javax.servlet.*;
import java.io.*;
public class HelloServlet extends HttpServlet
{
public void doGet( HttpServletRequest req, HttpServletResponse resp )
throws ServletException, IOException
{
PrintWriter writer = resp.getWriter();
writer.println( "<h1>Hello World</h1>" );
}
}
Here's my web.xml:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"[URL unfurl="true"]http://java.sun.com/dtd/web-app_2_3.dtd">[/URL]
<web-app>
<servlet>
<servlet-name>HelloServlet</servlet-name>
<servlet-class>HelloServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>HelloServlet</servlet-name>
<url-pattern>/helloservlet/*</url-pattern>
</servlet-mapping>
</web-app>
Thank you,
--
-- Ghodmode
Give a man a fish and he'll come back to buy more... Teach a man to fish and you're out of business.