This Season
 

Introduction to Java Servlets

Introduction to Java Servletsthumbnail
Java servlets are one of the many building blocks of web development.

Java servlets are an integral part of developing a web application in Java. From responding to client requests to processing and returning a response, it's difficult to create a web application of any complexity without the use of servlets at some level. Even Java server pages (JSPs) are compiled by the servlet container into servlets behind the scenes. A web application consisting entirely of JSPs is still primarily a servlet-based website.

Related Searches:
    1. History

      • Java servlets were introduced by Sun in 1997 as a means to get Java programming into the Internet development scene. Eventually, servlets were incorporated into what is now known as the Java Enterprise Edition (Java EE or J2EE in some contexts), which comprises servlets, JSPs, Enterprise Java Beans (EJB) and several other technologies. Servlets play a large role in web development and are a key part of any Java developer's repertoire.

      Servlet Requirements

      • Just as any other web development technology (such as PHP, Perl CGI or ASP) requires special server software and configuration, so do servlets. Servers that are designed to work with Java servlets (and JSPs) are generally known as "servlet containers" or "application servers." These containers have a dual purpose, serving the content (similar to Apache or other "standard" web servers) as well as executing the underlying Java code.

        Several free and commercial containers exist; common ones include Apache Tomcat, IBM's WebSphere, Sun's GlassFish and JBoss.

      How Servlets Process Requests

      • Servlets follow a standard method of handling client requests. The request comes through the application server, which determines which servlet the request is for and what type of processing the servlet is supposed to perform (such as whether or not the request is an HTTP POST or a GET). The server calls the appropriate functionality on the servlet, which processes the request as desired. Once the servlet finishes with the request, it sends a response to the client.

      Servlets and JSPs

      • While it is possible--and even relatively common--to develop a Java-based website using strictly JSPs, including servlets in the design can greatly increase the extensibility and maintainability of the website for future development. By using JSPs strictly for presentation, and performing the vast bulk of logic within servlets, it's easier to extract logic for testing, or even to other classes and libraries where the code can be reused.

      Servlet Deployment

      • Developers who come to Java servlets from PHP or similar environments might first be somewhat confused by the development model. Unlike other web development environments, servlets require the compilation and deployment of a web application, most commonly through "WAR" files, or web application archives. This is a version of the standard JAR file with which most Java developers are familiar, and it includes all of the generated servlets, web content and related configuration files.

    Related Searches

    References

    Resources

    • Photo Credit Building blocks image by Andrius Grigaliunas from Fotolia.com

    Read Next:

    Comments

    You May Also Like

    • Java 2 Tutorials

      Java 2 Tutorials. Java is an object-oriented programming language. It was developed by Sun Microsystems Inc. and became very popular for its...

    • How to Run Java Servlets

      Java Servlets refer to Java programming language objects that are used to take requests from users or other computer systems dynamically and...

    • Websphere Process Server System Requirements

      Websphere Process Server System Requirements. IBM's Websphere Process Server allows you to control your business more easily using many automated processes. It...

    • How Do I Search a File Created Using Java Servlet?

      Java servlet applications allow you to create software that runs on any operating system. Java programming is not compiled until it is...

    • Servlets Life Cycle

      Sun Microsystems developed the Java Servlet definition in the mid-1990s to address disadvantages of other technologies, such as the Common Gateway Interface...

    • How to Open a Word Document From a Servlet Response

      Java servlets are Web services run on host servers that provide an interface for developers to work with the internal business objects....

    • Alternatives to Macromedia Flash Player

      Adobe Flash Player (formerly Macromedia Flash Player) is a multimedia platform which has become the standard for implementing animation and interactivity into...

    • How to Get a URL in a Servlet

      In the Java programming language, a servlet is a class that is used to extend a server's capability that is accessed by...

    • How to Add Import to a JSP File

      JavaServer Pages, JSP, is a part of the Java language that enables developers to create dynamic web pages. JSP was added to...

    Follow eHow

    Related Ads