A variation on this approach is to use a portlet and a backing file instead of the Presentation ID of the page. The portlet approach requires a urlKey preference with the URL as the value and the backing file setting the value into the request. The urlKey then is pulled from the request instead of from the servletContext. The backing file code can be written something like this:

The portlet approach is better if you need to define some or all of your IFrame pages at run-time without restarting the application.

One last note. The 100% height setting does not work on Windows Vista (or at least on Vista Ultimate, which was discovered while writing this article), which should give you the excuse you need to upgrade to portlets as soon as possible. Meanwhile, you can work around this with fixed height (if all your apps can use the same size), a height preference in your portlet (if you went the portlet/backing file route) or a JavaScript function to dynamically set the IFrame height.