FileDocCategorySizeDatePackage
WaitServlet.javaAPI DocExample725Sat Apr 23 22:35:38 BST 2005None

WaitServlet

public class WaitServlet extends HttpServlet

Fields Summary
Constructors Summary
Methods Summary
public voiddoGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)

		String waitStr = request.getParameter("time");
		if ( waitStr == null )
			throw new ServletException("Missing parameter: time");
		int wait = Integer.parseInt(waitStr);

		try {
			Thread.sleep( wait * 1000 );
		} catch( InterruptedException e ) { 
			throw new ServletException(e); 
		}

        response.setContentType("text/html");
        PrintWriter out = response.getWriter();
        out.println("<html><body><h1>WaitServlet Response</h1></body></html>");