File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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

Compiling Servlets with HTML

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 javax.servlet.*;
import javax.servlet.http.*;
public class HelloWWW extends HttpServlet {
public void doGet(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException {
PrintWriter out = response.getWriter();
out.println(ServletUtilities.headWithTitle("Hello World") +
"<BODY>\n" +
"<H1>Hello WWW</H1>\n" +
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 13036
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.
I agree. Here's the link:
subject: Compiling Servlets with HTML
It's not a secret anymore!