Class PageMgr

  extended by fc.web.page.PageMgr

public final class PageMgr
extends java.lang.Object

Manages pages. Pages are found below a web document root directory. Pages are compiled as needed and the resulting class file is loaded/run. If a page is changed, it is automatically recompiled, reloaded and rerun. If the page has a compilation error, that page remains unloaded until the error is fixed.

A new PageMgr should be instantiated for each unique root directory (for example with multiple virtual hosts or users, each having their own root directory).

Constructor Summary
PageMgr(PageServlet servlet, java.io.File docroot, java.io.File scratchdir, Log log)
          Constructs a new Page manager.
Method Summary
 Page getPage(java.lang.String contextRelativePath)
          Returns the Page corresponding the the page path.
static void main(java.lang.String[] args)
          Interactive page manager use/testing.
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public PageMgr(PageServlet servlet,
               java.io.File docroot,
               java.io.File scratchdir,
               Log log)
Constructs a new Page manager. The page manager will use the system classpath and /WEB-INF/classes, /WEB-INF/lib as the classpath for complilation. Pages can refer to any class found in those locations.

servlet - the Molly Servlet. This is optional and can be null when creating/testing the PageMgr from the command line.
docroot - absolute path to the document root directory within which the pages are found. This is the directory that correspond to the "/" location of the webapp.
scratchdir - absolute path to a scratch dirctory where intermediate and temporary files can be written. This is where the translated page-->java file will be created.
log - a logging destination.
Method Detail


public Page getPage(java.lang.String contextRelativePath)
             throws java.lang.Exception
Returns the Page corresponding the the page path.



public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Interactive page manager use/testing.