Top
Interstage Studio User's Guide
FUJITSU Software

2.1.1 What are Web Applications?

Web applications are applications that are used from a Web browser, which is operating as the client. This is based on an arrangement whereby dynamic contents usage technology from a servlet container is added to the HTTP Web communication functions from a Web server.
Web applications can be used to implement client layer user interfaces, presentation layers to business logic that's implemented for example by an EJB, and similar.

Web applications operate as follows:

  1. The Web application URL is accessed.

  2. The Web page is displayed on the Web browser.

  3. The user enters data in an HTML form, and then sends the data (as an HTTP request).

  4. The server processes the data, then returns the response page (as an HTTP response)to the client

  5. The process returns to Step 2, and the processing can be repeated.

Brief explanations of the technology used in the creation of Web applications are given below.

HTTP

HTTP (HyperText Transfer Protocol) is the protocol used to send and receive requests between a Web server and a client (a browser or similar). When the client sends a request to the Web server, the Web server returns a response in accordance with the request.
Frequently-used requests include the GET method, which is a request to get a particular page, and the POST method, which is used to send data entered in a form to the Web server.

HTML

HTML is a convention devised to describe the logical structure of a document by means of attaching tags to the contents. HTML is used to publish information on the internet, and has become the de facto coding language for Web browsers. HTML conventions have been extended in line with advancements in Web browsers.

Cascading Style Sheet (CSS)

A CSS is a file that holds style information for displaying an HTML page. This file can be used to specify the layout of a page on a browser and do design details. Extensions to HTML conventions have enabled appearance information to be coded within HTML, but the original purpose of HTML was the coding of logical structures, and many HTML modifications are required to unify the appearance within a site. In order to lessen the impact of this problem, CSS files that keep appearance information separate from HTML were devised as style sheets.

JavaScript

JavaScript is a script language created in order to attach operations that display calculated results and other operations to HTML documents. These scripts currently run on almost all browsers. Care is required with implementation since different browsers implement APIs and so on in different ways.

Servlet

Servlets are a type of technology for dynamically generating HTML documents on a Web server, and thus enable data entered from a Web browser to be processed on a server. Servlets provide technology that solves the redundancy, session management, and other problems of the conventional Web server technology, such as the widespread CGI (Common Gateway Interface).

A servlet interface must be implemented to create a servlet class. The getting of parameters from a request object and the creation of a response object are implemented as methods. The creation of a response object conventionally outputs an HTML document. However, now that JSP has been devised, JSP is usually used to create dynamic HTML documents, and servlets are used for tasks such as allocating processing to EJB services and JSP.

A servlet is initialized at the first request, and the same instance is used for subsequent requests. Therefore, servlets must be created to be thread-safe.

JSP (JavaServer Pages)

Servlet technology is used to make dynamic HTML contents, but servlet programs contain a mix of logic processed by servers and HTML content, which makes coding difficult. JSP makes it possible to enter Java in HTML files in order to output dynamic contents (for example, data embedding).

During operation, JSP is converted to the servlet class then executed by the server. Thus, the basic technology for executing JSP is the same as for a servlet.

JSTL

JSTL (JSP Standard Tag Library) is a JSP tag library standardized by the Java Community Process (JCP) as JSR-052. JSTL provides frequently-used common functions grouped together as a tag library.

JSF (JavaServer Faces)

JSF (JavaServer Faces) is a specification formulated by the Java Community Process (JCP) as JSR-127. It is an application framework used for creating user interfaces for Web applications.

2.1.1.1 Modifications since J2EE1.4

The specification for Web applications included in Java EE is Servlet 2.5. The JSP specification is JSP 2.1.

The following are the main changes in Servlet 2.5:

The following are the main functional additions in JSP 2.1:

Annotation

Annotation can now be used in Servlet 2.5, thus enabling Dependency Injection. As a result, JNDI lookup processing need not be coded in source, and referenced resource declarations, and so on, need not be coded in web.xml.

The main annotations are as follows:

web.xml Modifications

The web.xml description method has been improved. The description method has been changed so that multiple patterns and elements can be described as a group. As a result, the volume of descriptions has decreased and readability has improved.

Unified EL is usable

The Expression Language introduced by JSP2.0 has been unified with the JSF Expression Language. Under Unified EL, coding in both the ${} format and the #{} format can be used.