Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.caucho.jsp
Class JspManager

    java.lang.Object
      |
      +--com.caucho.jsp.PageManager
            |
            +--com.caucho.jsp.JspManager

public class JspManager
extends PageManager

Manages JSP templates. The JspManager allows for a template style of JSP. A servlet can use JSP 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 test.jsp is a JavaScript JSP file, testObject will be assigned to the global variable "test".

     JspManager manager;

     void init()
     {
       manager = new JspManager(getServletContext());
     }

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

       // get the JSP template
       Page page = manager.createPage("WEB-INF/jsp/test.jsp");

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

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

See Also:
  `Page`

Constructor Summary
`JspManager(ServletContext context)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### JspManager

    public JspManager(ServletContext context)

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD