Definition

servlet

A servlet is a small program that runs on a server. The term was coined in the context of the Java applet, a small program that is sent as a separate file along with a Web (HTML) page. Java applets, usually intended for running on a client, can result in such services as performing a calculation for a user or positioning an image based on user interaction.

Some programs, often those that access databases based on user input, need to be on the server. Typically, these have been implemented using a Common Gateway Interface (CGI) application. However, with a Java running in the server, such programs can be implemented with the Java programming language. The advantage of a Java servlet on servers with lots of traffic is that they can execute more quickly than CGI applications. Rather than causing a separate program process to be created, each user request is invoked as a thread in a single daemon process, meaning that the amount of system overhead for each request is slight.

Instead of a URL that designates the name of a CGI application (in a "cgi-bin" subdirectory), a request in a form on a Web HTML page that results in a Java servlet getting called would call a URL that looks like this:

   http://www.whatis.com:8080/servlet/gotoUrl?http://www.someplace.com

The "8080" port number in the URL means the request is intended directly for the Web server itself. The "servlet" would indicate to the Web server that a servlet was being requested.

Add-on modules allow Java servlets to run in Netscape Enterprise, Microsoft Internet Information Server (IIS), and Apache servers.

This was last updated in April 2005

Continue Reading About servlet

Dig Deeper on Java Web Services

PRO+

Content

Find more PRO+ content and other member only offers, here.

Join the conversation

1 comment

Send me notifications when other members comment.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Please create a username to comment.

easy way of explanations.. thank u.. now i started to learn java servlet. explanation which you gave is very usefull to me if u can sent more materials to my email id..
Cancel

-ADS BY GOOGLE

File Extensions and File Formats

Powered by:

SearchSoftwareQuality

SearchCloudApplications

SearchAWS

TheServerSide

SearchWinDevelopment

Close