This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Customer Requirements for Developers and have Marcho Behler on-line!
See this thread for details.
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

Win a copy of Customer Requirements for Developers this week in the Jobs Discussion forum!
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: 12983
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!