|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.zkoss.web.servlet.dsp.Interpreter
public class Interpreter
The interpreter of the DSP file.
Note: we recognize only <%, <\%, %>, %\>, ${ and $\{. Unlike JSP, we don't recognize \${ or \$\{.
Constructor Summary | |
---|---|
Interpreter()
Constructor. |
Method Summary | |
---|---|
static java.lang.String |
getContentType(java.lang.String path)
Returns the content type by specifying a path, or null if no content type is available or path is null. |
void |
interpret(DspContext dc,
java.lang.String content,
java.lang.String ctype,
XelContext xelc)
Interprets the specified content and generates the result to the output specified in DspContext . |
void |
interpret(javax.servlet.ServletContext ctx,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
java.lang.String content,
java.lang.String ctype,
Locator locator)
Interprets the specified content based on the HTTP request. |
void |
interpret(javax.servlet.ServletContext ctx,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
java.io.Writer out,
java.lang.String content,
java.lang.String ctype,
Locator locator)
Interprets the specified content based on the HTTP request. |
Interpretation |
parse(java.lang.String content,
java.lang.String ctype,
XelContext xelc,
Locator loc)
Parses a content to a meta format called Interpretation . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Interpreter()
Method Detail |
---|
public static final java.lang.String getContentType(java.lang.String path)
It determines the content type by looking the extension. Note: it considers the extension of "a.css.dsp" as "css".
public final Interpretation parse(java.lang.String content, java.lang.String ctype, XelContext xelc, Locator loc) throws DspException, java.io.IOException, XelException
Interpretation
.
xelc
- the context formation for evaluating ZUL expressions.
It can be null, in which case no additional functions
and variable resolvers are initialized at the beginning.ctype
- the content type. Optional. It is used only if
no page action at all. If it is not specified and not page
action, "text/html" is assumed.
DspException
java.io.IOException
XelException
public final void interpret(DspContext dc, java.lang.String content, java.lang.String ctype, XelContext xelc) throws DspException, java.io.IOException, XelException
DspContext
.
dc
- the interpreter context; never null.content
- the content of DSP to interpretctype
- the content type. Optional. It is used only if
no page action at all. If it is not specified and not page
action, "text/html" is assumed.
DspException
java.io.IOException
XelException
public final void interpret(javax.servlet.ServletContext ctx, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.String content, java.lang.String ctype, Locator locator) throws DspException, java.io.IOException, XelException
DspContext
and then invoke interpret(DspContext, String, String, XelContext)
.
locator
- used to locate resources, such as taglib.
If null is specified, the locator for the specified servlet context is
used. (In other words, we use ServletContextLocator
if locator is null).ctype
- the content type. Optional. It is used only if
no page action at all. If it is not specified and not page
action, "text/html" is assumed.
DspException
java.io.IOException
XelException
public final void interpret(javax.servlet.ServletContext ctx, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.io.Writer out, java.lang.String content, java.lang.String ctype, Locator locator) throws DspException, java.io.IOException, XelException
DspContext
and then invoke interpret(DspContext, String, String, XelContext)
.
locator
- used to locate resources, such as taglib.
If null is specified, the locator for the specified servlet context is
used. (In other words, we use ServletContextLocator
if locator is null).ctype
- the content type. Optional. It is used only if
no page action at all. If it is not specified and not page
action, "text/html" is assumed.out
- the output to generate the result.
If null, it is the same as interpret(ServletContext,HttpServletRequest,HttpServletResponse,String,String,Locator)
In other words, response.getWriter() is used.
DspException
java.io.IOException
XelException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |