Hi,
I am on day 1 of trying out servlets. I am using j2sdk1.4.1_05 and resin-ee-3.0.6. The resin seem to be set up OK according to my tutorial and PATH, CLASSPATH and JAVA_HOME have all been set.
My problem arises when I try to compile a simple HelloServlet.java that has been downloaded form the Sun website.
I always get the error "javax.servlet does not exist, import javax.servlet.*"
Does javax.servlet not come with j2sdk1.4.1_05 and where do I obtain it.
The book I am using makes no mention anywhere of this problem. I am following the tutorial in 'Core Servlets and JavaServer Pages' by Marty Hall and Larry Brown (excellent book) and the code for the HelloServlet is
public class HelloServlet extends HttpServlet {
public void doGet(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html"
;
PrintWriter out = response.getWriter();
String docType =
"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 " +
"Transitional//EN\">\n";
out.println(docType +
"<HTML>\n" +
"<HEAD><TITLE>Hello</TITLE></HEAD>\n" +
"<BODY BGCOLOR=\"#FDF5E6\">\n" +
"<H1>Hello</H1>\n" +
"</BODY></HTML>"
;
}
}
simple enough but I can't get over the first hurdle.
Grateful for any help
regards
ALSav
I am on day 1 of trying out servlets. I am using j2sdk1.4.1_05 and resin-ee-3.0.6. The resin seem to be set up OK according to my tutorial and PATH, CLASSPATH and JAVA_HOME have all been set.
My problem arises when I try to compile a simple HelloServlet.java that has been downloaded form the Sun website.
I always get the error "javax.servlet does not exist, import javax.servlet.*"
Does javax.servlet not come with j2sdk1.4.1_05 and where do I obtain it.
The book I am using makes no mention anywhere of this problem. I am following the tutorial in 'Core Servlets and JavaServer Pages' by Marty Hall and Larry Brown (excellent book) and the code for the HelloServlet is
public class HelloServlet extends HttpServlet {
public void doGet(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html"
PrintWriter out = response.getWriter();
String docType =
"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 " +
"Transitional//EN\">\n";
out.println(docType +
"<HTML>\n" +
"<HEAD><TITLE>Hello</TITLE></HEAD>\n" +
"<BODY BGCOLOR=\"#FDF5E6\">\n" +
"<H1>Hello</H1>\n" +
"</BODY></HTML>"
}
}
simple enough but I can't get over the first hurdle.
Grateful for any help
regards
ALSav