Hi All,
    This might be a simple Question. But i am sure it helpful to many of
us. Here is the sequence. I load a Applet on the Clients Browser. Then i
create a new Object which implemens Serializable. Then i get the
OutputStream for URLConnection to the Servlet. When i say WriteObject,
then the request goes to the Servlet.

Now at the Servlet side i noticed that processing of the request is done
in the service(HttpServletRequest request, HttpServletResponse response)
method the Servlet. Now instead of service if i use method
doPost(HttpServletRequest request, HttpServletResponse response) then
also the request get's processed and the client gets back the data.

Can someone tell me the order or precedence in which these methods in
servlet are called. Please not i am not using any Form. It's a simple
URLConnection and writing Data from Applet. Here is the Sample Code

At the Client Side
***************

       URL myUrl = new URL ("http://prithvi:8080/servlet/testServlet");
       URLConnection con = myUrl.openConnection();

      con.setDoInput(true);
       con.setDoOutput(true);
       con.setUseCaches(false);
       con.setDefaultUseCaches(false);
       con.setRequestProperty("Content-type",
"application/octet-stream");

       ObjectOutputStream out = new
ObjectOutputStream(con.getOutputStream());
       SBSRequest myObject = new SBSRequest(100);

       //passing a serialized object to the servlet

       out.writeObject(myObject);
       out.close();

___________________________________________________________________________
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