wood burning stoves 2.0*
The moose likes Servlets and the fly likes Compiling Servlets with HTML Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Compiling Servlets with HTML" Watch "Compiling Servlets with HTML" New topic
Author

Compiling Servlets with HTML

Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
I am trying to compile & run the Servlet HelloWWW below. The servlet is placed in C:\Tomcat\jakarta-tomcat\webapps\ROOT\WEB-INF\classes\coreservletsEB-INF\classes .
When i try to compile the HelloWWW3 i get the error message "Class ServletUtilities not found". Any help is apreciated.

import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class HelloWWW extends HttpServlet {
public void doGet(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html");
PrintWriter out = response.getWriter();
out.println(ServletUtilities.headWithTitle("Hello World") +
"<BODY>\n" +
"<H1>Hello WWW</H1>\n" +
"</BODY></HTML>");
}
}
Thanks.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12681
    
    5
The reason probably is that the ServletUtilities class is not part of the standard library so your import statements are not finding it.
You need to figure out which package ServletUtilities lives in.


Java Resources at www.wbrogden.com
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Compiling Servlets with HTML
 
Similar Threads
I am not able to run JSP and Servlets :(
Help in compiling Servlet program
tomcat can't find index.jsp
getting error while running servlet in tomcat
Trying to test my first servlet.