Hey Scott,

A good book to pick up is "Java Servlets" by Karl Moss (McGraw-Hill ISBN
0-07-135188-4)...


http://www.amazon.com/exec/obidos/ISBN%3D0071351884/keysolutionsA/103-872346
8-6787043

Also there's tons of great reference stuff on the net. A good place to start
is at Sun...

        http://java.sun.com/docs/books/tutorial/servlets/index.html

http://developer.java.sun.com/developer/onlineTraining/Servlets/Fundamentals
/contents.html


Hope this stuff helps bud!

Mike Cronin
Data On Call


-----Original Message-----
From: A mailing list for discussion about Sun Microsystem's Java Servlet
API Technology. [mailto:[EMAIL PROTECTED]]On Behalf Of
Carter, Scott
Sent: Tuesday, June 04, 2002 12:18 PM
To: [EMAIL PROTECTED]
Subject: Very begginer question


I am guessing that the first method hit is doGet.  When is the doPost method
run?  What other special methods are there that execute at pre defined
times?  The example I am looking at is below, it is one of the free examples
that comes with the Tomcat web server.

Thanks - Scott



import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;

public class RequestInfo extends HttpServlet {

    public void doGet(HttpServletRequest request, HttpServletResponse
response)
    throws IOException, ServletException
    {
        response.setContentType("text/html");
        PrintWriter out = response.getWriter();
        out.println("<html>");
        out.println("<body>");
        out.println("<head>");
        out.println("<title>Request Information Example</title>");
        out.println("</head>");
        out.println("<body>");
        out.println("<h3>Request Information Example</h3>");
        out.println("Method: " + request.getMethod());
        out.println("Request URI: " + request.getRequestURI());
        out.println("Protocol: " + request.getProtocol());
        out.println("PathInfo: " + request.getPathInfo());
        out.println("Remote Address: " + request.getRemoteAddr());
        out.println("</body>");
        out.println("</html>");
    }

    /**
     * We are going to perform the same operations for POST requests
     * as for GET methods, so this method just sends the request to
     * the doGet method.
     */

    public void doPost(HttpServletRequest request, HttpServletResponse
response)
    throws IOException, ServletException
    {
        doGet(request, response);
    }
}

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to