import java.io.*; import javax.servlet.*; import javax.servlet.http.*; /** * ApplicationServlet is a small example of a servlet that can also * be called as an application. * * @author mitch fincher, mitch[at]fincher[dot]org */ //////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////// public class ApplicationServlet extends HttpServlet { //////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////// public void doGet (HttpServletRequest req, HttpServletResponse res) //////////////////////////////////////////////////////////////// throws ServletException, IOException { res.setContentType("text/html"); ServletOutputStream sout = res.getOutputStream(); PrintStream out = new PrintStream(sout); String name = req.getParameter("name"); doMyFunction(out,name); } //////////////////////////////////////////////////////////////// public void doMyFunction(PrintStream out, String Name) //////////////////////////////////////////////////////////////// { out.println("
"); out.println("