Java Reference
In-Depth Information
The
setContentLength()
method sets the content length of the current response.
setContentLength()
returns no value and throws no exceptions.
It has one parameter:
•
int
The
setContentType()
Method
public void setContentType(java.lang.String type)
The
setContentType()
method sets the content type of the current response. You can set this
property only once for the current response. This method must be called before calling the
getWriter()
or
getOuputStream()
methods.
setContentType()
returns no value and throws
no exceptions.
It has one parameter:
•
java.lang.String
The
setLocale()
Method
public void setLocale(Locale locale)
The
setLocale()
method sets the response locale, including headers and character sets.
setLocale()
returns no value and throws no exceptions.
It has one parameter:
•
Locale
The
SingleThreadModel
Interface
public interface SingleThreadModel
The
SingleThreadModel
interface defines a single threaded model for implementing the
servlet's execution. Implementing this interface makes the servlet thread safe. This guarantees
that the implementing servlet's service method will not be executed concurrently by more than
one thread. No methods are defined by the
SingleThreadModel
interface.
Classes
Classes for the
javax.servlet
package are
GenericServlet
,
ServletInputStream
, and
ServletOutputStream
. Their methods are described in the following sections.