| FazBrowse Wikipedia Viewer | Main Page | | |
| Viewing: https://en.wikipedia.org/wiki/Java_Servlet |
| Contents |
|---|
| History |
| Container servers |
| See also |
| Citations |
| References |
A Jakarta Servlet, formerly Java Servlet is a Java software component that extends the capabilities of a server. Although servlets can respond to many types of requests, they most commonly implement web containers for hosting web applications on web servers and thus qualify as a server-side servlet web API. Such web servlets are the Java counterpart to other dynamic web content technologies such as PHP and ASP.NET.
HttpServlet class. Thus "servlet" is often used as shorthand for "HTTP servlet". Thus, a servlet can be used to add dynamic content to a web server using the Java platform. The generated content is commonly HTML, but may be other data such as XML and more commonly, JSON.The Jakarta Servlet API has, to some extent, been supersededFacesServlet.
A somewhat older usage is to use servlets in conjunction with JSPs in a pattern called "Model 2", which is a flavor of the model–view–controller.
The Java Servlet API was first publicly announced at the inaugural JavaOne conference in May 1996. About two months after the announcements at the conference, the first public implementation was made available on the JavaSoft website. This was the first alpha of the Java Web Server (JWS; then known by its codename Jeeves) which would eventually be shipped as a product on June 5, 1997.
In his blog on java.net, Sun veteran and GlassFish lead Jim Driscoll details the history of servlet technology. James Gosling first thought of servlets in the early days of Java, but the concept did not become a product until December 1996 when Sun shipped JWS. This was before what is now Jakarta EE was made into a specification.
The Servlet1 specification was created by Pavni Diwanji while she worked at Sun Microsystems, with version 1.0 finalized in June 1997. Starting with version 2.2, the specification was developed under the Java Community Process.
| Servlet API version | Released | Specification | Platform | Important Changes | ||
|---|---|---|---|---|---|---|
| Jakarta Servlet 6.1 | March 28, 2024 | 6.1 | Jakarta EE 11 | improve HTTP status code and character encoding support | ||
| Jakarta Servlet 6.0 | May 31, 2022 | 6.0 | Jakarta EE 10 | remove deprecated features and implement requested enhancements | ||
| Jakarta Servlet 5.0 | October 9, 2020 | 5.0 | Jakarta EE 9 | API moved from package —N/a | JDK 1.1 | Part of April 1998 Java Servlet Development Kit 2.0 |
| Java Servlet 1.0 | December 1996 | packageorg.wikipedia.examples;
importjava.io.IOException;
importjakarta.servlet.ServletConfig;
importjakarta.servlet.ServletException;
importjakarta.servlet.http.HttpServlet;
importjakarta.servlet.http.HttpServletRequest;
importjakarta.servlet.http.HttpServletResponse;
publicclass ServletLifeCycleExampleextendsHttpServlet{
privateintsharedCounter;
privatefinalObjectlock=newObject();
@Override
publicvoidinit(ServletConfigconfig)throwsServletException{
super.init(config);
getServletContext().log("init() called");
}
@Override
protectedvoidservice(HttpServletRequestrequest,HttpServletResponseresponse)throwsServletException,IOException{
getServletContext().log("service() called");
varlocalCounter=0;
synchronized(lock){
localCounter=++sharedCounter;
}
varwriter=response.getWriter();
writer.write("Incrementing the count to "+localCounter);// accessing a local variable
writer.flush();// flush response
}
@Override
publicvoiddestroy(){
getServletContext().log("destroy() called");
}
}
Container serverseditThe specification for Servlet technology has been implemented in many products. See a list of implementations on the web container page. There are also other types of servlet containers such as those for SIP servlets, e.g., SailFin. See alsoedit
Citationsedit
Freedman, Matt (June 26, 1996). "JavaOne conference report". JavaWorld. Archived from the original on 2018-07-26. Retrieved 2018-07-25.
Referencesedit
Jakarta EE specifications | ||||
formerly known as: Java Platform, Enterprise Edition (Java EE) and Java 2 Platform, Enterprise Edition (J2EE) | ||||||
| Web app | ||||||
| Enterprise app | ||||||
| Web services | ||||||
| Other | ||||||
| Removed | ||||||
| Related | ||||||
See also: Category:Java enterprise platform | ||||||
| Protocols | |
|---|---|
| Server APIs | |
| Apache modules | |
| Topics | |
| Browser APIs | |||||||||
|---|---|---|---|---|---|---|---|---|---|
| Web APIs |
| ||||||||
| Topics | |||||||||
Related topics | |
| View original on Wikipedia | Back | FazBrowse Home |