Java Help

The SingleThreadmodel Interface
The SingleThreadModel interface is used to indicate that only a single thread should execute the service( ) method of a servlet, It defines no constants and declares no methods. If a servlet implements this interface, the server creates several instances of it. When a client request arrives, it is sent to an available instance of the servlet.

The GenericServlet Class
The GcnericScrvlct class provides implementations of the basic life cycle methods for a servlet and is typically subclassed by servlet developers. Gcn cricOs vlct implements the Servlet and Servlet Config interfaces. In addition, a method to append a string to the server log file IS availabLE. The signature of this method is shown here: void log(String-s) Acres is the string? to be appended to the log,

The servletinputstream Class
The ServletinputStream class extends InputStream. It is implemented by the server and provides an input stream that a servlet developer can use to rend the data from” .client request. It defines the default constructor, In addition, a method is provided to .read bytes from the stream.Its signature is-shown here  int readLine byte Iliffe~,int offset, int,she) throws IOException Here, buffer is the array into which size bytes arc placed starting at offset. The method returns the actual number of layers read,or  if an end-of-stream condition is encountered.

  • Feel free to send us an inquiry, we will reply back in hours.


Posted on September 18, 2014 in Servlets

Share the Story

About the Author

Back to Top
Share This