/** * SimpleServlet * * Displays the current date. * * by Paul Colton * (c) 1999 Allaire Corporation */ import java.io.*; import java.util.*; import java.net.*; import javax.servlet.*; import javax.servlet.http.*; /** * SimpleServlet extends JRunDemoServlet and displays * a simple text string. */ public class SimpleServlet extends JRunDemoServlet { /** * JRun invokes the service method whenever the servlet is requested * by a client. The service method is invoked for both GET and POST * requests. Alternatively, you could place this code in the doGet and * doPost methods. */ public void service( HttpServletRequest req, HttpServletResponse res ) throws IOException { // Set the content-type to HTML res.setContentType( "text/html; charset=euc-jp" ); // Get the PrintWriter for the servlet response PrintWriter out = res.getWriter(); // Begin the demo page. This method is defined in JRunDemoServlet. generateDemoPageStart( out ); // Say hello. out.println( "<CENTER><FONT SIZE=+1 FACE=\"arial\">サーブレットが正常に実行されました!</FONT></CENTER>" ); // End the demo page. This method is defined in JRunDemoServlet. generateDemoPageEnd( req, res, out ); } }