simple.page
Class Composer

java.lang.Object
  extended by simple.page.Composer

public class Composer
extends java.lang.Object

The Composer object is used to convert a requested JSP source file to an executable Java object. This is essentially the only object that needs to be dealt with to translate, compile, and create a page object. JSP pages are translated and compiled with this using a URI path reference, such as "/path/to/Source.jsp".

To avoid re-translation and compilation delays this makes use of background compilation. Background compilation enables pages to be requested rapidly after the first compilation, and updated with and atomic operation when the JSP page or its includes change.

Author:
Niall Gallagher

Constructor Summary
Composer(Context context)
          Constructor for the Composer object.
Composer(Context context, Workspace project)
          Constructor for the Composer object.
 
Method Summary
 Page compose(java.lang.String target)
          This is used to acquire the Page instance for the named JSP source.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Composer

public Composer(Context context)
         throws java.lang.Exception
Constructor for the Composer object. This requires a file system context, which is used to determine where the JSP pages are acquired from. It allows URI paths like "/Example.jsp" to be mapped on to the appropriate JSP source file within the file system. This context creates a default configuraiton.

Parameters:
context - this is the interface to the OS file system
Throws:
java.lang.Exception

Composer

public Composer(Context context,
                Workspace project)
         throws java.lang.Exception
Constructor for the Composer object. This requires a file system context and a project configuration. With this constructor the Workspace object, rather than the file system context, is used to determine where the JSP source files are acquired from. So requests like "/Example.jsp" are evaluated by the configuration in order to determine the file system location. The context is passed to the page.

Parameters:
context - this is the interface to the OS file system
project - this specifies the layout for the project
Throws:
java.lang.Exception
Method Detail

compose

public Page compose(java.lang.String target)
             throws java.lang.Exception
This is used to acquire the Page instance for the named JSP source. If the requested JSP source has not been previously compiled this will perform the translation and compilation process before creating a an instance of the page.

Parameters:
target - this is the JSP source to be created as a page
Returns:
this returns a page object to render the JSP page
Throws:
java.lang.Exception