home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 2000 November
/
PCWorld_2000-11_cd.bin
/
Komunik
/
sambar444
/
_SETUP.1
/
Hello.java
< prev
next >
Wrap
Text File
|
1999-08-28
|
913b
|
37 lines
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class Hello extends HttpServlet
{
/** Unused */
public void service (HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException
{
super.service(req, resp);
}
public void doGet (HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException
{
resp.setContentType("text/html");
PrintWriter pw = resp.getWriter();
pw.print("<HTML>\n<HEAD><TITLE>Hello Servlet</TITLE>");
pw.print("</HEAD><BODY>\n\n<H1>Hello Servlet</H1>\n");
pw.print("Hello world!\n");
pw.print(System.getProperty("sessionTimeout"));
pw.print("</BODY>\n</HTML>");
pw.flush();
}
public void doPost(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException
{
doGet(req, resp);
}
}