here's the code - having problems running the file
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.PrintWriter;
import java.io.IOException;
public class SampleServlet extends HttpServlet {
static int numRequests = 0;
public void init(ServletConfig config) throws ServletException {
super.init(config);
}
public void services(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{
response.setContentType("text/html"
PrintWriter out = response.getWriter();
out.println("<HTML>"
out.println("<HEAD><TITLE>Sample Sevlet</TITLE>
<script LANGUAGE=JAVASCRIPT>
<!--
function _CF_checkgetquestion(_CF_this)
{
return true;
}
//-->
</script>
<script LANGUAGE=JAVASCRIPT>
<!--
function _CF_checkgetquestion(_CF_this)
{
return true;
}
//-->
</script>
</HEAD>"
out.println("<BODY>"
out.println("<H1>Hello world</H1>"
numRequests++;
out.println("<p>This servlet has been requested " + numRequests + " times."
out.close();
}
public String getServletInfo()
{
return "Sample Servlet version 1.0";
}
public void destroy()
{
}
}
The problems I'm having are - I have the servlet class installed and I can see the class in my class viewing tree???
SampleServlet.java:10: Class ServletConfig not found.
public void init(ServletConfig config) throws ServletException {
error: File D:\jdk1.2.2\src\javax\servlet\ServletException.class does not contain type ServletException as expected, but class javax.servlet.ServletException. Please remove the file, or make sure it appears in the correct subdirectory of the class path.
SampleServlet.java:10: Class ServletException not found in throws.
public void init(ServletConfig config) throws ServletException {
SampleServlet.java:11: Class ServletConfig not found in void init(ServletConfig).
super.init(config);
SampleServlet.java:14: Class ServletException not found in throws.
public void services(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException [sig]<p>Dano<br><a href=mailto:dskryzer@hotmail.com>dskryzer@hotmail.com</a><br><a href= </a><br>What's your major malfunction[/sig]
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.PrintWriter;
import java.io.IOException;
public class SampleServlet extends HttpServlet {
static int numRequests = 0;
public void init(ServletConfig config) throws ServletException {
super.init(config);
}
public void services(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{
response.setContentType("text/html"
PrintWriter out = response.getWriter();
out.println("<HTML>"
out.println("<HEAD><TITLE>Sample Sevlet</TITLE>
<script LANGUAGE=JAVASCRIPT>
<!--
function _CF_checkgetquestion(_CF_this)
{
return true;
}
//-->
</script>
<script LANGUAGE=JAVASCRIPT>
<!--
function _CF_checkgetquestion(_CF_this)
{
return true;
}
//-->
</script>
</HEAD>"
out.println("<BODY>"
out.println("<H1>Hello world</H1>"
numRequests++;
out.println("<p>This servlet has been requested " + numRequests + " times."
out.close();
}
public String getServletInfo()
{
return "Sample Servlet version 1.0";
}
public void destroy()
{
}
}
The problems I'm having are - I have the servlet class installed and I can see the class in my class viewing tree???
SampleServlet.java:10: Class ServletConfig not found.
public void init(ServletConfig config) throws ServletException {
error: File D:\jdk1.2.2\src\javax\servlet\ServletException.class does not contain type ServletException as expected, but class javax.servlet.ServletException. Please remove the file, or make sure it appears in the correct subdirectory of the class path.
SampleServlet.java:10: Class ServletException not found in throws.
public void init(ServletConfig config) throws ServletException {
SampleServlet.java:11: Class ServletConfig not found in void init(ServletConfig).
super.init(config);
SampleServlet.java:14: Class ServletException not found in throws.
public void services(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException [sig]<p>Dano<br><a href=mailto:dskryzer@hotmail.com>dskryzer@hotmail.com</a><br><a href= </a><br>What's your major malfunction[/sig]