This is a discussion on What is the Servlet Interface? within the Java Programming forums, part of the Software Development category; What is the Servlet Interface?...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
| |||
| Servlet Interface The servlet interface can be used to start the network server remotely. To use the servlet interface, the servlet must be registered with a web server and derby.system.home must be known to the web server. A Web application archive (WAR) file, derby.war, for the IBM Cloudscape Network Server is available in $CLOUDSCAPE_INSTALL/frameworks/NetworkServer/war. This WAR registers the Network Server's servlet at the relative path /derbynet. Please see the documentation for your Application Server for instructions on how to install it. For example, if derby.war is installed in Websphere Application Server with a context root of cns, then the URL of the server is: http://server[ ort]/cns/derbynetNote: A servlet engine is not part of the Network Server. The servlet takes the following optional configuration parameters: • portNumber specifies the port number to be used by the network server. • startNetworkServerOnInit specifies that the network server is to be started when the servlet is initialized. • tracingDirectory specifies the location for trace files. If the tracing directory is not specified, the traces are placed in derby.system.home. |
| |||
| Interface Servlet All servlets implement this interface. Servlet writers typically do this by subclassing either GenericServlet, which implements the Servlet interface, or by subclassing GenericServlet's descendent, HttpServlet. Developers need to directly implement this interface only if their servlets cannot (or choose not to) inherit from GenericServlet or HttpServlet. For example, RMI or CORBA objects that act as servlets will directly implement this interface. The Servlet interface defines methods to initialize a servlet, to receive and respond to client requests, and to destroy a servlet and its resources. These are known as life-cycle methods, and are called by the network service in the following manner: 1. Servlet is created then initialized. 2. Zero or more service calls from clients are handled 3. Servlet is destroyed then garbage collected and finalized Initializing a servlet involves doing any expensive one-time setup, such as loading configuration data from files or starting helper threads. Service calls from clients are handled using a request and response paradigm. They rely on the underlying network transport to provide quality of service guarantees, such as reordering, duplication, message integrity, privacy, etc. Destroying a servlet involves undoing any initialization work and synchronizing persistent state with the current in-memory state. |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Can we write Construcror in Servlet? | leoraja8 | Java Programming | 1 | 11-23-2007 09:51 PM |
| How to send data from servlet to javascript variables | Pvinothkumar | HTML, CSS and Javascript Coding Techniques | 0 | 10-09-2007 11:05 PM |
| Servlet creation and servlet loading........ | leoraja8 | Java Programming | 4 | 09-25-2007 12:22 AM |
| How to pass data (including JavaBeans) to a JSP from a servlet? | anbuchezhians | Java Server Pages (JSP) | 1 | 08-01-2007 11:47 PM |
| Do we have interface to schedule a task like ITaskscheduler interface for desktop.... | theone | Mobile Software Development | 1 | 07-24-2007 11:29 PM |