Presentation Tier Components
J2EE presentation tier components can be developed using Java servlets and Java Sever Pages (JSP). These components both operate within a conceptual container as do Java applets. These containers provide various services for the component that allow it to run in a secure, efficient environment.
These components are often referred to as a Web tier components since they are primarily designed to interact with Web browsers using the HTTP protocol. Java servlets were the first Web component. A servlet is a Java object which is a subclass of certain servlet API classes. The servlet accepts an HTTP request and provides an HTTP response within the body of certain methods called by the servlet container. If the response is being returned as an HTML document, then the Java code within the body of the method being called by the container.
The JSP specification followed the initial servlet specification. JSP pages are created by interspersing JSP scriplets amongst HTML. The JSP is then converted into a Java servlet and executed within a servlet container. Thus JSP can easily be implemented on top of an existing servlet container.