001    package hirondelle.web4jtools.util;
002    
003    import hirondelle.web4j.action.ResponsePage;
004    
005    /**
006    * Create templated {@link ResponsePage} objects.
007    * 
008    * <P><span class='highlight'>This implementation assumes that related JSPs and classes reside in 
009    * the same directory.</span> This policy is unusual, but recommended. Having <em>all</em> items 
010    * related to a feature in the same directory - classes, JSPs, and .sql files - is highly 
011    * satisfying and natural. 
012    */
013    public final class TemplatedPage {
014      
015      /**
016      * Return a templated page for displaying plain text, not markup.
017      */
018      public static ResponsePage getPlain(String aTitle, String aBodyJsp, Class aRepresentativeClass) {
019        return new ResponsePage(aTitle, aBodyJsp, PLAIN, aRepresentativeClass);
020      }
021      
022      // PRIVATE //
023      
024      private TemplatedPage(){}
025      
026      private static final String PLAIN = "../TemplatePlain.jsp";
027    }