hi, im new to tomcat 5. im having problems running servlets.
i can run jsp and html files from the following location
and i can run this over the network, when i substitute my ip address for localhost, without problems.
the class paths are set up propperly as far as i can see but here they are just in case.
***************************
CATALINA_HOME
C:\Tomcat 5.0;
****************************
****************************
CLASSPATH
C:\Tomcat 5.0\common\lib\servlet-api.jar;
C:\Program Files\Java\jdk1.5.0\jre\lib\ext\servlet.jar\;
C:\Tomcat 5.0\webapps\ROOT\WEB-INF\classes;
%CATALINA_HOME%\common\lib\servlet-api.jar;
****************************
****************************
Path
C:\Program Files\Java\jdk1.5.0\jre\lib\ext\servlet.jar;
****************************
here is the web.xml file
the package is in the WEB-INF/classes/test/ServletTest folder.
This is the ServletTest.java file
the ServletTest.htm is in the ROOT folder of tomcat 5
my appologies for this being exreamly long but im at a loss as to why it wont run.
thanks in advance for any help on this.
dexter
i can run jsp and html files from the following location
and i can run this over the network, when i substitute my ip address for localhost, without problems.
the class paths are set up propperly as far as i can see but here they are just in case.
***************************
CATALINA_HOME
C:\Tomcat 5.0;
****************************
****************************
CLASSPATH
C:\Tomcat 5.0\common\lib\servlet-api.jar;
C:\Program Files\Java\jdk1.5.0\jre\lib\ext\servlet.jar\;
C:\Tomcat 5.0\webapps\ROOT\WEB-INF\classes;
%CATALINA_HOME%\common\lib\servlet-api.jar;
****************************
****************************
Path
C:\Program Files\Java\jdk1.5.0\jre\lib\ext\servlet.jar;
****************************
here is the web.xml file
Code:
<web-app>
<display-name>A simple Web Application</display-name>
<servlet>
<servlet-name>ServletTest</servlet-name>
<servlet-class>test.ServletTest</servlet-class>
</servlet>
<welcome-file-list>
<welcome-file>ServletTest.html</welcome-file>
</welcome-file-list>
</web-app>
the package is in the WEB-INF/classes/test/ServletTest folder.
This is the ServletTest.java file
Code:
package test;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class ServletTest extends HttpServlet
{
// the doGet() method is overwritten
public void doGet(HttpServletRequest httpServReqRequest, HttpServletResponse httpServResResponce) throws ServletException, IOException
{
PrintWriter pwOutput = httpServResResponce.getWriter();
pwOutput.println("Hello World");
}
}
the ServletTest.htm is in the ROOT folder of tomcat 5
Code:
//ServletTest.htm
<HTML>
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<TITLE>
Untitled Document
</TITLE>
</HEAD>
<BODY>
<FORM ACTION="/servlets/test/ServletTest" METHOD="GET">
<INPUT TYPE="SUBMIT" VALUE="Go....">
</FORM>
</BODY>
</HTML>
my appologies for this being exreamly long but im at a loss as to why it wont run.
thanks in advance for any help on this.
dexter