home *** CD-ROM | disk | FTP | other *** search
Wrap
Java Source | 1998-10-25 | 1.7 KB | 35 lines
import java.io.*; import javax.servlet.*; import javax.servlet.http.*; public class hello extends HttpServlet { public String getServletInfo() { return "Hello version 1.06: A trivial sample servlet from vqSoft";} public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { log("invoked"); res.setStatus(HttpServletResponse.SC_OK); res.setContentType("text/html"); PrintWriter os=res.getWriter(); os.println("<html>"); os.println("<head><title>Hello!</title></head>"); os.println("<body bgcolor=#add8af>"); os.println("<table border=0 cellspacing=0 cellpadding=2 cols=3 width=100%>"); os.println("<tr><td valign=top>"); os.println("<h1 align=center>Hello!</h1>"); os.println("<p><hr></p>"); os.println("<p>This page was generated by <i>Hello</i>, "); os.println("a very simple sample servlet supplied with <a href=http://www/vqsoft.com/vq/server/index.html><i>vq</i>Server</a>. "); 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>"); os.println("<p><hr></p>"); 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."); os.println("</td>"); os.println("<td width=20></td>"); os.println("<td valign=top width=150>"); os.println("<a href=/index.html><img src=/vq/server/icons/utab.gif border=0 height=15 width=15>Home page</A>"); os.println("</td>"); os.println("</table>"); os.println("</body></html>"); os.flush();}}