|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.caucho.jsp.PageManager | +--com.caucho.jsp.XtpManager
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);
}
Page
Method Summary | |
static XtpManager |
getManager(ServletContext context)
Returns the XTP manager for the given ServletContext. |
void |
setStrictXml(boolean strictXml)
Requires XTP documents conform to strict XML. |
void |
setStrictXsl(boolean strictXsl)
Requires XTL stylesheets to conform to strict XSL. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Method Detail |
public void setStrictXml(boolean strictXml)
public void setStrictXsl(boolean strictXsl)
public static XtpManager getManager(ServletContext context)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |