|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.zkoss.zest.sys.ZestManager
public class ZestManager
The core of ZEST that matches URL, instantiates actions, invokes actions and forwards to a view.
By default, the manager ignores a path if its extension does not
match any of the allowed extensions. If you'd like more complex
algorithm to decide which to ignore, you could override pathIgnored(java.lang.String, java.lang.String[])
.
Constructor Summary | |
---|---|
ZestManager()
Constructor. |
Method Summary | |
---|---|
boolean |
action(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Handles the action. |
protected void |
coerceParameters(ActionContext ac,
java.lang.Object action)
Coerces the request's parameters to action's corresponding fields. |
void |
destroy()
Destroyes the manager. |
static ZestManager |
getManager(javax.servlet.ServletContext ctx)
Returns the manager associated with the context, or null if not initialized yet. |
javax.servlet.ServletContext |
getServletContext()
Returns the servlet context that this manager is associated with |
void |
init(javax.servlet.ServletContext ctx,
Parser parser)
Initializes the manager. |
void |
loadConfiguration(Parser parser,
java.lang.String configURI)
Loads the configuration. |
protected boolean |
pathIgnored(java.lang.String path,
java.lang.String extension,
java.lang.String[] allowedExts)
Returns whether the given path shall be ignored. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ZestManager()
Method Detail |
---|
public static ZestManager getManager(javax.servlet.ServletContext ctx)
public void init(javax.servlet.ServletContext ctx, Parser parser)
parser
- the parser used to parse the configuration file (/WEB-INF/zest.xml)public void destroy()
public javax.servlet.ServletContext getServletContext()
public void loadConfiguration(Parser parser, java.lang.String configURI)
/WEB-INF/zest.xml
)
configURI
- the URI of the configuration file, such as
(/WEB-INF/zest.xml
).public boolean action(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, java.io.IOException
javax.servlet.ServletException
java.io.IOException
protected void coerceParameters(ActionContext ac, java.lang.Object action) throws java.lang.Throwable
java.lang.Throwable
protected boolean pathIgnored(java.lang.String path, java.lang.String extension, java.lang.String[] allowedExts)
Default: the path is ignored if the extension does not match one of the given allowed extensions.
path
- the given path to testextension
- the extension of the path (it is part of path).
It is an empty string if there is no extension.allowedExts
- the allowed extension. If null or zero-length,
it means all paths are allowed.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |