{{Citation style|date=May 2016|details=Violates Wikipedia:External links: "Wikipedia articles may include links to web pages outside Wikipedia (external links), but they should not normally be used in the body of an article."}}
Servlets are most often used to process or store a [[JavaFile:JSPLife.png|thumb|400px|Life class]]of ina [[JavaJSP EEfile]] that conforms to the Java Servlet API,<ref>[http://docs.oracle.com/javaee/7/api/javax/servlet/Servletvlet.html Java Servlet API]</ref> a standard for implementing Java classes that respond to requests. Servlets could in principle communicate over any [[client–server model|client–server]] protocol, but they are most often used with the [[Hypertext Transfer Protocol|HTTP protocol]]. Thus "servlet" is often used as shorthand for "HTTP servlet".<ref name="r1">[http://www.novocode.com/doc/servlet-essentials/chapter1.html] 1.1 What is a servlet?</ref> Thus, a [[software developer]] may use a servlet to add [[dynamic web page|dynamic content]] to a [[web server]] using the [[Java platform]]. The generated content is commonly [[HTML]], but may be other data such as [[XML]]. Servlets can maintain [[state (computer science)|state]] in [[session (computer science)|session]] variables across many server transactions by using [[HTTP cookie]]s, or [[rewriting]] URLs.▼
[[File:JSPLife.png|thumb|400px|Life of a JSP file]]
A '''Java servlet''' is a [[Java (programming language) |Java]] [[Computer program|program]] that extends the capabilities of a [[Server (computing)|server]]. Although servlets can respond to any types of requests, they most commonly implement applications hosted on [[Web server]]s.<ref>{{cite web
| accessdate = 2011-04-27
| ___location = http://www.webopedia.com/
| publisher = WEBOPEDIA| title = servlet
| quote = A small java program that runs on a server. The term usually refers to a Java applet which runs within a web server environment. This is analogous to a Java applet that runs within a web browser environment.
| url = http://www.webopedia.com/TERM/S/servlet.html}}</ref> Such Web servlets are the [[Java (software platform)|Java]] counterpart to other dynamic Web content technologies such as [[PHP]] and [[ASP.NET]].
== Introduction ==
▲Servlets are most often used to process or store a [[Java class]] in [[Java EE]] that conforms to the Java Servlet API,<ref>[http://docs.oracle.com/javaee/7/api/javax/servlet/Servlet.html Java Servlet API]</ref> a standard for implementing Java classes that respond to requests. Servlets could in principle communicate over any [[client–server model|client–server]] protocol, but they are most often used with the [[Hypertext Transfer Protocol|HTTP protocol]]. Thus "servlet" is often used as shorthand for "HTTP servlet".<ref name="r1">[http://www.novocode.com/doc/servlet-essentials/chapter1.html] 1.1 What is a servlet?</ref> Thus, a [[software developer]] may use a servlet to add [[dynamic web page|dynamic content]] to a [[web server]] using the [[Java platform]]. The generated content is commonly [[HTML]], but may be other data such as [[XML]]. Servlets can maintain [[state (computer science)|state]] in [[session (computer science)|session]] variables across many server transactions by using [[HTTP cookie]]s, or [[rewriting]] URLs.
To deploy and run a servlet, a [[web container]] must be used. A web container (also known as a servlet container) is essentially the component of a web server that interacts with the servlets. The web container is responsible for managing the lifecycle of servlets, mapping a URL to a particular servlet and ensuring that the URL requester has the correct access rights.