Java Servlets
#1

Definition
Servlets are modules that extend request/response-oriented servers, such as Java-enabled web servers. For example, a servlet might be responsible for taking data in an HTML order-entry form and applying the business logic used to update a company's order database. Servlets are to servers what applets are to browsers. Unlike applets, however, servlets have no graphical user interface. Servlets can be embedded in many different servers because the servlet API, which you use to write servlets, assumes nothing about the server's environment or protocol. Servlets have become most widely used within HTTP servers; many web servers support Java Servlet technology.

Use Servlets instead of CGI Scripts.
Servlets are an effective replacement for CGI scripts. They provide a way to generate dynamic documents that is both easier to write and faster to run. Servlets also address the problem of doing server-side programming with platform-specific APIs: they are developed with the Java Servlet API, a standard Java extension.
So use servlets to handle HTTP client requests. For example, have servlets process data POSTed over HTTPS using an HTML form, including purchase order or credit card data. A servlet like this could be part of an order-entry and processing system, working with product and inventory databases, and perhaps an on-line payment system.

Other Uses for Servlets
Here are a few more of the many applications for servlets:
" Allowing collaboration between people. A servlet can handle multiple requests concurrently, and can synchronize requests. This allows servlets to support systems such as on-line conferencing.

" Forwarding requests. Servlets can forward requests to other servers and servlets. Thus servlets can be used to balance load among several servers that mirror the same content, and to partition a single logical service over several servers, according to task type or organizational boundaries.

Architecture of the Servlet Package
The javax.servlet package provides interfaces and classes for writing servlets. The architecture of the package is described below.

The Servlet Interface
The central abstraction in the Servlet API is the Servlet interface. All servlets implement this interface, either directly or, more commonly, by extending a class that implements it such as HttpServlet

The Servlet interface declares, but does not implement, methods that manage the servlet and its communications with clients. Servlet writers provide some or all of these methods when developing a servlet.

Client Interaction
When a servlet accepts a call from a client, it receives two objects:
" A ServletRequest , which encapsulates the communication from the client to the server.

" A ServletResponse , which encapsulates the communication from the servlet back to the client.
ServletRequest and ServletResponse are interfaces defined by the javax.servlet package.

The Servlet Request Interface
The ServletRequest interface allows the servlet access to:
" Information such as the names of the parameters passed in by the client, the protocol (scheme) being used by the client, and the names of the remote host that made the request and the server that received it.
" The input stream, ServletInputStream . Servlets use the input stream to get data from clients that use application protocols such as the HTTP POST and PUT methods.
Interfaces that extend ServletRequest interface allow the servlet to retrieve more protocol-specific data. For example, the HttpServletRequest interface contains methods for accessing HTTP-specific header information.

The Servlet Response Interface
The ServletResponse interface gives the servlet methods for replying to the client. It:
" Allows the servlet to set the content length and MIME type of the reply.
" Provides an output stream, ServletOutputStream , and a Writer through which the servlet can send the reply data.
Reply

Important Note..!

If you are not satisfied with above reply ,..Please

ASK HERE

So that we will collect data for you and will made reply to the request....OR try below "QUICK REPLY" box to add a reply to this page
Popular Searches: sandboxing in java, java sunspot, java for netbanking, engineering projects on jsp servlets, ieee paper ppt on servlets for computer science in pdf, source code for pnr status using java servlets, servlets seminar topic with abstract,

[-]
Quick Reply
Message
Type your reply to this message here.

Image Verification
Please enter the text contained within the image into the text box below it. This process is used to prevent automated spam bots.
Image Verification
(case insensitive)

Possibly Related Threads...
Thread Author Replies Views Last Post
  E-COMPILER FOR JAVA WITH SECURITY EDITOR smart paper boy 7 11,854 27-07-2013, 01:06 PM
Last Post: computer topic
  E-COMPILER FOR JAVA WITH SECURITY EDITOR seminar class 9 13,627 24-06-2013, 11:44 AM
Last Post: Guest
  Java Cryptography Architecture (JCA) seminar projects crazy 1 2,570 17-12-2012, 01:51 PM
Last Post: seminar details
Lightbulb Java Cryptography Architecture (JCA) computer science crazy 1 2,621 17-12-2012, 01:51 PM
Last Post: seminar details
  Java Programs IO STREAMS computer girl 0 835 08-06-2012, 12:17 PM
Last Post: computer girl
  if u can help me in java RMI ahmed abed 2 1,755 04-02-2012, 11:37 AM
Last Post: seminar addict
  JAVA RMI Technology seminar surveyer 3 3,193 26-01-2012, 10:31 AM
Last Post: seminar addict
  JAVA RING A SEMINAR REPORT Computer Science Clay 6 6,631 07-01-2012, 12:19 PM
Last Post: project uploader
  Bluetooth & Java smart paper boy 2 1,523 24-08-2011, 09:33 AM
Last Post: seminar addict
  Java Debug Hardware Modules Using JBits smart paper boy 0 1,020 18-08-2011, 02:00 PM
Last Post: smart paper boy

Forum Jump: