|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.zkoss.web.util.resource.ServletContextLocator
public class ServletContextLocator
Locator based on ServletContext.
| Constructor Summary | |
|---|---|
ServletContextLocator(javax.servlet.ServletContext ctx)
Constructor. |
|
ServletContextLocator(javax.servlet.ServletContext ctx,
boolean acceptURL)
Constructor. |
|
ServletContextLocator(javax.servlet.ServletContext ctx,
String dir)
Constructor. |
|
ServletContextLocator(javax.servlet.ServletContext ctx,
String dir,
String prefix)
Constructor. |
|
ServletContextLocator(javax.servlet.ServletContext ctx,
String dir,
String prefix,
boolean acceptURL)
Constructor. |
|
| Method Summary | |
|---|---|
boolean |
equals(Object o)
|
String |
getDirectory()
|
URL |
getResource(String name)
|
InputStream |
getResourceAsStream(String name)
|
javax.servlet.ServletContext |
getServletContext()
Returns the servlet context. |
int |
hashCode()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ServletContextLocator(javax.servlet.ServletContext ctx)
public ServletContextLocator(javax.servlet.ServletContext ctx,
boolean acceptURL)
acceptURL - whether to URL (such as file:/, http:// and
ftp://) are accepted. In other words, Servlets.getResource(javax.servlet.ServletContext, java.lang.String)
will be used.Servlets.getResource(javax.servlet.ServletContext, java.lang.String)
public ServletContextLocator(javax.servlet.ServletContext ctx,
String dir)
dir - the directory used when relative path is specified
(for getResource(java.lang.String) and getResourceAsStream(java.lang.String)).
It must be null, empty, or starts with /.
public ServletContextLocator(javax.servlet.ServletContext ctx,
String dir,
String prefix)
public ServletContextLocator(javax.servlet.ServletContext ctx,
String dir,
String prefix,
boolean acceptURL)
Another example, if prefix is "/WEB-INF/cwr" and dir is "/subdir", then getResource("abc") will look for "/WEB-INF/cwr/subdir/abc".
dir - the directory used when relative path is specified
(for getResource(java.lang.String) and getResourceAsStream(java.lang.String)).
It must be null, empty, or starts with /.prefix - the directory to prefix each directory specified
(for getResource(java.lang.String) and getResourceAsStream(java.lang.String)).
It must be null, empty, or starts with /.acceptURL - whether to URL (such as file:/, http:// and
ftp://) are accepted. In other words, Servlets.getResource(javax.servlet.ServletContext, java.lang.String)
will be used.| Method Detail |
|---|
public javax.servlet.ServletContext getServletContext()
public String getDirectory()
getDirectory in interface org.zkoss.util.resource.Locatorpublic URL getResource(String name)
getResource in interface org.zkoss.util.resource.Locatorpublic InputStream getResourceAsStream(String name)
getResourceAsStream in interface org.zkoss.util.resource.Locatorpublic int hashCode()
hashCode in class Objectpublic boolean equals(Object o)
equals in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||