home *** CD-ROM | disk | FTP | other *** search
/ IT.SOFT 22 / ITSOFTCD_22.iso / pc / shareware22 / file3 / VQSERVER.ZIP / servlets / hello / hello.java < prev   
Encoding:
Java Source  |  1998-10-25  |  1.7 KB  |  35 lines

  1. import java.io.*;
  2. import javax.servlet.*;
  3. import javax.servlet.http.*;
  4.  
  5. public class hello extends HttpServlet {
  6.  
  7.   public String getServletInfo() {    
  8.     return "Hello version 1.06: A trivial sample servlet from vqSoft";}
  9.  
  10.   public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {
  11.     log("invoked");
  12.     res.setStatus(HttpServletResponse.SC_OK);
  13.     res.setContentType("text/html");
  14.     PrintWriter os=res.getWriter();
  15.     os.println("<html>");
  16.     os.println("<head><title>Hello!</title></head>");
  17.     os.println("<body bgcolor=#add8af>");
  18.     os.println("<table border=0 cellspacing=0 cellpadding=2 cols=3 width=100%>");
  19.     os.println("<tr><td valign=top>");
  20.     os.println("<h1 align=center>Hello!</h1>");
  21.     os.println("<p><hr></p>");
  22.     os.println("<p>This page was generated by <i>Hello</i>, ");
  23.     os.println("a very simple sample servlet supplied with <a href=http://www/vqsoft.com/vq/server/index.html><i>vq</i>Server</a>. ");
  24.     os.println("<i>Hello</i> demonstrates that servlets conforming to the JavaSoft servlet specification version 2.0 are supported by <i>vq</i>Server.</p>");
  25.     os.println("<p><hr></p>");
  26.     os.println("<p><i>Hello</i> version 1.06. <i>Hello</i> and <a href=http://www/vqsoft.com/vq/server/index.html><i>vq</i>Server</a> are copyright © <i>vq</i>Soft and Steve Shering 1998.");
  27.     os.println("</td>");    
  28.     os.println("<td width=20></td>");
  29.     os.println("<td valign=top width=150>");
  30.     os.println("<a href=/index.html><img src=/vq/server/icons/utab.gif border=0 height=15 width=15>Home page</A>");
  31.     os.println("</td>");
  32.     os.println("</table>");
  33.     os.println("</body></html>");
  34.     os.flush();}}
  35.