|
I'm
reading the book JAVA SERVER PROGRAMMING form WROX.
I have
created my first servlet HelloWorld.java
import java.io.*;
import javax.servlet.*; import javax.servlet.http.*; public class HelloWorld extends
HttpServlet
{ public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { response.setContentType("text/html"); PrintWriter out = response.getWriter(); out.println("<html>"); out.println("<body>"); out.println("<head>"); out.println("<title>Hello World!</title>"); out.println("</head>"); out.println("<body>"); out.println("<h1>Hello World!</h1>"); out.println("</body>"); out.println("</html>"); } } which works fine Then I created a public class named HTML which is a HTML generator package javacode.util; public class HTML public StringBuffer buffer; public void add(int style, String text, boolean
linebreak) public
String
getPage() How can I use this class in other servlets? I tried to make it jar file and import it in another servlet and when I deployed it I got the following message:
|
