Basic HTML version of Foils prepared May 19 99

Foil 8 The service method

From Overview of JDBC: Java Database Connectivity Java Servlets -- Spring Semester 1999. by Nancy McCracken


public void service (ServletRequest req, ServletResponse res)
Each request message from the client results in invoking the service method.
There are two ways the client can send information:
  • parameter name/value pairs
  • streams - the servlet can invoke getInputStream(), which returns a ServletInputStream.
Similarly, the servlet can invoke getOutputStream () to generate the response. Other methods, such as setContentType can set information that the web server will use in generating the output to the client.
More than one instance of the service method can be invoked at one time to respond to multiple requests.



© Northeast Parallel Architectures Center, Syracuse University, npac@npac.syr.edu

If you have any comments about this server, send e-mail to webmaster@npac.syr.edu.

Page produced by wwwfoil on Mon Jul 5 1999