| java.lang.Object com.caucho.jsp.PageManager com.caucho.jsp.XtpManager
XtpManager | public class XtpManager extends PageManager (Code) | | 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: Page |
createPage | Page createPage(Path path, String uri, String className, ServletConfig config, ArrayList<PersistentDependency> dependList) throws Exception(Code) | | Creates a new XTP page. The stylesheet is given by
<?xml-stylesheet href='...'?>, or default.xsl if none is specified.
The stylesheet is parsed immediately, but it is only applied
when the request is processed. See XtpPage for the actual
processing.
Parameters: path - Path to the XTP file. Parameters: uri - The uri for the XTP file. Parameters: uriPwd - The parent of uri. the page or null for not found |
getDefaultStylesheet | public String getDefaultStylesheet()(Code) | | Returns the default stylesheet.
|
setDefaultStylesheet | public void setDefaultStylesheet(String stylesheet)(Code) | | Sets the default stylesheet.
|
setEntitiesAsText | public void setEntitiesAsText(boolean entitiesAsText)(Code) | | If true, parse XML with entities as text
|
setStrictXml | public void setStrictXml(boolean strictXml)(Code) | | Requires XTP documents conform to strict XML. If false (the
default), XTP files are loose HTML.
|
setStrictXsl | public void setStrictXsl(boolean strictXsl)(Code) | | Requires XTL stylesheets to conform to strict XSL. If false (the
default), XTP files follow the XSLT-lite syntax.
|
setToLower | public void setToLower(boolean toLower)(Code) | | If true, HTML tags are normalized to lower-case.
|
Methods inherited from com.caucho.jsp.PageManager | abstract Page createPage(Path path, String uri, String className, ServletConfig config, ArrayList<PersistentDependency> dependList) throws Exception(Code)(Java Doc) void destroy()(Code)(Java Doc) public Path getAppDir()(Code)(Java Doc) public Path getClassDir()(Code)(Java Doc) public Page getPage(String uri, Path path) throws Exception(Code)(Java Doc) public Page getPage(String uri, String pageURI, Path path, ServletConfig config) throws Exception(Code)(Java Doc) public Page getPage(String uri, String pageURI, Path path, ServletConfig config, ArrayList<PersistentDependency> dependList) throws Exception(Code)(Java Doc) WebApp getWebApp()(Code)(Java Doc) protected void initPageManager()(Code)(Java Doc) void initWebApp(WebApp webApp)(Code)(Java Doc) void killPage(HttpServletRequest request, HttpServletResponse response, Page page)(Code)(Java Doc) void setPageCacheMax(int max)(Code)(Java Doc)
|
|
|