Hi Guys,
This is my first post in the forum. I'm trying to work on servlets. I have a win98 system on which tomcat 4.0 has been installed. The JSP pages seems to work fine but when I try to execute the servlets, it gives me error like
"The requested resource (/test/servlet/HelloWorldExample) is not available."
I think I'm not configuring the server properly. Let me tell you what I have done.
My directory name is called test for which I have already made an entry in the SERVER.XML file under
"C:\Program Files\Apache Group\Tomcat 4.1\conf\"
as
<Context path="/test" docBase="test" debug="0" reloadable="true" crossContext="true"/>
uptil this point all the jsp files work fine. Now, for the servlets to work fine.. I created a WEB-INF directory under the test directory and a classes directory under the WEB-INF directory as:
"C:\Program Files\Apache Group\Tomcat 4.1\webapps\test\WEB-INF\classes\"
Then I created a basic web.xml file under web-inf directory like this:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"
<web-app>
<display-name>Welcome to Tomcat</display-name>
<description>
Welcome to Tomcat
</description>
</web-app>
and I wrote a HelloWorldExample.java program like this:
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class HelloWorld extends HttpServlet {
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws IOException, ServletException
{
response.setContentType("text/html"
PrintWriter out = response.getWriter();
out.println("<html>"
out.println("<body>"
out.println("<head>"
out.println("<title>Hello World!</title>"
out.println("</head>"
out.println("<body>"
out.println("<h1>Hello World!</h1>"
out.println("</body>"
out.println("</html>"
}
}
which compiles without any problem.
And then I execute the above servlet like this:
"
for which I get the error as
*****
type Status report
message /test/servlet/HelloWorldExample
description The requested resource (/test/servlet/HelloWorldExample) is not available.
******
can anybody tell me what is the problem.. or how to make this program work..
thanks a ton in advance.
This is my first post in the forum. I'm trying to work on servlets. I have a win98 system on which tomcat 4.0 has been installed. The JSP pages seems to work fine but when I try to execute the servlets, it gives me error like
"The requested resource (/test/servlet/HelloWorldExample) is not available."
I think I'm not configuring the server properly. Let me tell you what I have done.
My directory name is called test for which I have already made an entry in the SERVER.XML file under
"C:\Program Files\Apache Group\Tomcat 4.1\conf\"
as
<Context path="/test" docBase="test" debug="0" reloadable="true" crossContext="true"/>
uptil this point all the jsp files work fine. Now, for the servlets to work fine.. I created a WEB-INF directory under the test directory and a classes directory under the WEB-INF directory as:
"C:\Program Files\Apache Group\Tomcat 4.1\webapps\test\WEB-INF\classes\"
Then I created a basic web.xml file under web-inf directory like this:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"
<web-app>
<display-name>Welcome to Tomcat</display-name>
<description>
Welcome to Tomcat
</description>
</web-app>
and I wrote a HelloWorldExample.java program like this:
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class HelloWorld extends HttpServlet {
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws IOException, ServletException
{
response.setContentType("text/html"
PrintWriter out = response.getWriter();
out.println("<html>"
out.println("<body>"
out.println("<head>"
out.println("<title>Hello World!</title>"
out.println("</head>"
out.println("<body>"
out.println("<h1>Hello World!</h1>"
out.println("</body>"
out.println("</html>"
}
}
which compiles without any problem.
And then I execute the above servlet like this:
"
for which I get the error as
*****
type Status report
message /test/servlet/HelloWorldExample
description The requested resource (/test/servlet/HelloWorldExample) is not available.
******
can anybody tell me what is the problem.. or how to make this program work..
thanks a ton in advance.