public class XtpManager extends PageManager
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);
}
Page
PageManager.Entry
_autoCompile, _webApp
Modifier and Type | Method and Description |
---|---|
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.
|
allocatePageContext, allocatePageContext, createPageContextWrapper, freePageContext, freePageContextWrapper, getAppDir, getClassDir, getPage, getPage, getPage, initPageManager
public java.lang.String getDefaultStylesheet()
public void setDefaultStylesheet(java.lang.String stylesheet)
public void setStrictXml(boolean strictXml)
public void setStrictXsl(boolean strictXsl)
public void setToLower(boolean toLower)
public void setEntitiesAsText(boolean entitiesAsText)