Portal Example

Because state management is such an important part of web application development, I think it’s appropriate we end the chapter with an example application that showcases the material we’ve just covered. I’ve opted to create a portal application, that allows a registered visitor to create a personalized home page from a list of prebuilt components, as it is sufficiently complex to allow me to demonstrate a number of techniques. Figure 7-6 shows an overview of how the portal application is put together, including relationships between the various templates. The application uses all the persistent variable scopes we discussed with the exception of the server scope. We’ll cover all of the templates used in the application except for Login.cfm and Validate.cfm. These templates are discussed in Chapter 8.

Application flow for the portal example

Figure 7-6. Application flow for the portal example

Web Application Framework

The Application.cfm template shown in Example 7-2 has four functions in the portal application: it turns on client and session management, handles authentication, expires the session when appropriate, and sets application variables.

Example 7-2. Application.cfm Template for the Portal Application


Get Programming ColdFusion now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.