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. With 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 4GL and non-4GL JSP targets, you write server-side scripts in Java, although you can 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”.
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 JSP Targets.”
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.
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.
When you are working with a JSP target, you can create template pages in two ways:
4GL JSP pages provide an event-driven infrastructure that lets you create JSP 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 JSP pages, see Chapter 9, “Developing 4GL JSP Pages.”
Server-scripted pages let you create all of your own server scripts. JSP implicit objects and the Web Target object model without 4GL extensions provide a number of server objects that you integrate into your scripts. Other server-side object models are available for deployment to specific server types.
For more information about writing server scripts without the 4GL Web page technology, see “Working with server scripts” and “Managing page data”.