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 PowerDynamo or JSP, you can
take advantage of 4GL extensions to the Web Target object model. The
4GL Web page interface can handle many of the coding details for you.
For information about 4GL Web pages, see Chapter 9, “Developing 4GL Web 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 for
that server, such as the Active Server Pages object model or the
PowerDynamo 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 both PowerDynamo and 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:
- Respond
to input from a browser, returning data requested by the user.
For example, a user can complete a form on a Web page, then
view another page in response to data entered on the form. - Customize the output for each user.
After a user provides information on a Web page (such as areas
of interest, or level of expertise), the content delivered to the
user’s browser can be fine-tuned to the information provided. - Customize the output for the display capabilities
of the Web browser.
Different page presentations can be generated based on the
type of browser a client uses to access the Web site.
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:
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:
- 4GL Web pages provide an event-driven infrastructure that lets you create
pages with dynamic content easily. The Web Target object model extensions
that underlie these pages handle many of the coding details required
to produce dynamic pages.
For more information about 4GL Web pages, see Chapter 9, “Developing 4GL Web Pages”. - Server-scripted pages let you create all of your own server scripts. The Web Target
object model provides a number of server objects that you integrate
into your scripts. Other server-side object models are available for
deployment to specific server types.
Pages you deploy to Active Server Pages, to your file system,
or to more than one platform, require manual coding for server scripts–without recourse
to the automatic coding (for parameter binding and page data management)
available with 4GL page templates.For more information about writing server scripts without
the 4GL Web page technology, see “Working with server scripts “ and “Managing page data”.