Class XtpManager

  extended by com.caucho.jsp.PageManager
      extended by com.caucho.jsp.XtpManager

public class XtpManager
extends PageManager

Manages XTP templates. The XtpManager allows for a template style of XTP. A servlet can use XTP for its output.

The template API lets servlets assign implicit script variables for JavaScript. Filling up a HashMap with the variable name will do the trick.

An example servlet may look something like the following. If the stylesheet or the generated JSP file use JavaScript, testObject will be assigned to the global variable "test".

 void service(ServletRequest req, ServletResponse res)
   // do some processing here

   // get the XTP template
   XtpManager manager =  XtpManager.getManager(getServletContext());
   Page page = manager.createPage("WEB-INF/xtp/test.xtp");

   // fill in implicit variables (optional)
   HashMap vars = new HashMap();
   vars.put("test", testObject);

   // execute the template
   page.service(req, res, vars);

See Also:

Field Summary
Fields inherited from class com.caucho.jsp.PageManager
_autoCompile, _webApp
Method Summary
 java.lang.String getDefaultStylesheet()
          Returns the default stylesheet.
 void setDefaultStylesheet(java.lang.String stylesheet)
          Sets the default stylesheet.
 void setEntitiesAsText(boolean entitiesAsText)
          If true, parse XML with entities as text
 void setStrictXml(boolean strictXml)
          Requires XTP documents conform to strict XML.
 void setStrictXsl(boolean strictXsl)
          Requires XTL stylesheets to conform to strict XSL.
 void setToLower(boolean toLower)
          If true, HTML tags are normalized to lower-case.
Methods inherited from class com.caucho.jsp.PageManager
allocatePageContext, allocatePageContext, createPageContextWrapper, freePageContext, freePageContextWrapper, getAppDir, getClassDir, getPage, getPage, getPage, initPageManager
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Method Detail


public java.lang.String getDefaultStylesheet()
Returns the default stylesheet.


public void setDefaultStylesheet(java.lang.String stylesheet)
Sets the default stylesheet.


public void setStrictXml(boolean strictXml)
Requires XTP documents conform to strict XML. If false (the default), XTP files are loose HTML.


public void setStrictXsl(boolean strictXsl)
Requires XTL stylesheets to conform to strict XSL. If false (the default), XTP files follow the XSLT-lite syntax.


public void setToLower(boolean toLower)
If true, HTML tags are normalized to lower-case.


public void setEntitiesAsText(boolean entitiesAsText)
If true, parse XML with entities as text