| java.lang.Object org.zkoss.web.servlet.dsp.Interpreter
Interpreter | public class Interpreter (Code) | | The interpreter of the DSP file.
Note: we recognize only <%, <\%, %>, %\>, ${ and $\{.
Unlike JSP, we don't recognize \${ or \$\{.
author: tomyeh |
Method Summary | |
final public static String | getContentType(String path) Returns the content type by specifying a path, or null
if no content type is available or path is null. | final public void | interpret(DspContext dc, String content, String ctype, XelContext xelc) Interprets the specified content and generates the result to
the output specified in
DspContext .
Parameters: dc - the interpreter context; never null. Parameters: content - the content of DSP to interpret Parameters: ctype - the content type. | final public void | interpret(ServletContext ctx, HttpServletRequest request, HttpServletResponse response, String content, String ctype, Locator locator) Interprets the specified content based on the HTTP request.
It actually wraps the HTTP request into
DspContext and then invoke
Interpreter.interpret(DspContext,String,String,XelContext) .
Parameters: locator - used to locate resources, such as taglib.If null is specified, the locator for the specified servlet context isused. | final public void | interpret(ServletContext ctx, HttpServletRequest request, HttpServletResponse response, Writer out, String content, String ctype, Locator locator) Interprets the specified content based on the HTTP request.
It actually wraps the HTTP request into
DspContext and then invoke
Interpreter.interpret(DspContext,String,String,XelContext) .
Parameters: locator - used to locate resources, such as taglib.If null is specified, the locator for the specified servlet context isused. | final public Interpretation | parse(String content, String ctype, XelContext xelc, Locator loc) Parses a content to a meta format called
Interpretation .
Parameters: xelc - the context formation for evaluating ZUL exxpressions.It can be null, in which case no additional functionsand variable resolvers are initialized at the beginning. Parameters: ctype - the content type. |
Interpreter | public Interpreter()(Code) | | Constructor.
|
getContentType | final public static String getContentType(String path)(Code) | | Returns the content type by specifying a path, or null
if no content type is available or path is null.
It determines the content type by looking the extension.
Note: it considers the extension of "a.css.dsp" as "css".
|
interpret | final public void interpret(DspContext dc, String content, String ctype, XelContext xelc) throws javax.servlet.ServletException, IOException, XelException(Code) | | Interprets the specified content and generates the result to
the output specified in
DspContext .
Parameters: dc - the interpreter context; never null. Parameters: content - the content of DSP to interpret Parameters: ctype - the content type. Optional. It is used only ifno page action at all. If it is not specified and not pageaction, "text/html" is assumed. since: 3.0.0 |
interpret | final public void interpret(ServletContext ctx, HttpServletRequest request, HttpServletResponse response, String content, String ctype, Locator locator) throws javax.servlet.ServletException, IOException, XelException(Code) | | Interprets the specified content based on the HTTP request.
It actually wraps the HTTP request into
DspContext and then invoke
Interpreter.interpret(DspContext,String,String,XelContext) .
Parameters: locator - used to locate resources, such as taglib.If null is specified, the locator for the specified servlet context isused. (In other words, we use org.zkoss.web.util.resource.ServletContextLocatorif locator is null). Parameters: ctype - the content type. Optional. It is used only ifno page action at all. If it is not specified and not pageaction, "text/html" is assumed. |
interpret | final public void interpret(ServletContext ctx, HttpServletRequest request, HttpServletResponse response, Writer out, String content, String ctype, Locator locator) throws javax.servlet.ServletException, IOException, XelException(Code) | | Interprets the specified content based on the HTTP request.
It actually wraps the HTTP request into
DspContext and then invoke
Interpreter.interpret(DspContext,String,String,XelContext) .
Parameters: locator - used to locate resources, such as taglib.If null is specified, the locator for the specified servlet context isused. (In other words, we use org.zkoss.web.util.resource.ServletContextLocatorif locator is null). Parameters: ctype - the content type. Optional. It is used only ifno page action at all. If it is not specified and not pageaction, "text/html" is assumed. Parameters: out - the output to generate the result.If null, it is the same as Interpreter.interpret(ServletContext,HttpServletRequest,HttpServletResponse,String,String,Locator)In other words, response.getWriter() is used. since: 2.4.1 |
|
|