Integrating with application servers

If you want to deliver dynamic content for your Web site, you must integrate an application server (to process server-side scripts) into your Web site delivery strategy. For sites that use JSPs, you can take advantage of 4GL extensions to the Web Target object model. The 4GL JSP page interface can handle many of the coding details for you.

For information about 4GL JSP pages, see Chapter 9, “Developing 4GL JSP Pages.”

Selecting an object model

For non-4GL Web site targets, you can write scripts that directly target an application server using the object model specific to that server, such as the Active Server Pages object model. However, you can also write platform-independent code using the Web Target object model (without the 4GL extensions). If you want to deploy Web site targets to more than one application server platform, you need to write your server scripts in JavaScript, which is supported by ASP (as well as by most client browsers).

For 4GL and non-4GL JSP targets, you write server-side scripts in Java, although you can still use JavaScript for client-side scripting. You can also use the JSP implicit object model in your server scripts.

For more information about the implicit object model, see “Implicit objects”.

What an application server does

An application server processes code on the server system before a Web server sends a page to a Web browser. By taking advantage of the capabilities of an application server, you can include conditional execution, looping, and other programming structures in your Web pages.

Application servers process template or source files to return dynamic content. The server evaluates server scripts when the page is requested and generates the HTML page, which it sends to the client browser.

For an overview on how application servers fit into an integrated Web delivery environment, see Chapter 1, “Working with Web Targets.”

Dynamic Web pages

A dynamic page is a page that is generated each time it is accessed. Using application servers to create dynamic pages helps you enhance your Web site. Dynamic Web pages can:

Processing dynamic Web pages

The template for a dynamic Web page typically provides all of the following content before and after processing by an application server:

Table 7-1: Content processing by an application server

Template contents before processing

Contents after processing

HTML-encoded text

HTML-encoded text

Embedded Web DataWindows or database queries with instructions for formatting the retrieved data

Formatted database information

Server-side scripts

Results of execution of server scripts

Client-side scripts

Client-side scripts

Users do not see the unprocessed template page in their browsers. They see the page content after the application server processes the template page, and after their browser processes client-side scripts.

Two ways to create dynamic Web pages

When you are working with a Web target, you can create template pages in two ways: