public interface ExtendletContext
Servlets.getRequestDispatcher(javax.servlet.ServletContext, javax.servlet.ServletRequest, java.lang.String, java.util.Map, int)
will try to
resolve.
When Servlets.getRequestDispatcher(javax.servlet.ServletContext, javax.servlet.ServletRequest, java.lang.String, java.util.Map, int)
is
called, it detects whether ~xxx/ is specified.
If specified, it looks up any extended context
is registered as xxx. If found, the extend context is used.
If not found, it looks up any servlet context called xxx.
To registers an extended context, use
Servlets.addExtendletContext(javax.servlet.ServletContext, java.lang.String, org.zkoss.web.util.resource.ExtendletContext)
.
Modifier and Type | Method and Description |
---|---|
java.lang.String |
encodeRedirectURL(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
java.lang.String uri,
java.util.Map params,
int mode)
Returns the encoded URL for send redirect.
|
java.lang.String |
encodeURL(javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response,
java.lang.String uri)
Returns the encoded URL.
|
Locator |
getLocator()
Returns the locator of this context used to locate resources.
|
javax.servlet.RequestDispatcher |
getRequestDispatcher(java.lang.String uri) |
java.net.URL |
getResource(java.lang.String uri)
Returns the URL of the specified URI, or null if not found.
|
java.io.InputStream |
getResourceAsStream(java.lang.String uri)
Returns the resource of the specified URI as input stream,
or null if not found.
|
javax.servlet.ServletContext |
getServletContext()
Returns the servlet context.
|
void |
include(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
java.lang.String uri,
java.util.Map params)
Includes the specified page.
|
boolean |
shallCompress(javax.servlet.ServletRequest request,
java.lang.String ext)
Tests whether to compress the specified extension, e.g, "js" and
"css".
|
java.lang.String encodeURL(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, java.lang.String uri) throws javax.servlet.ServletException, java.io.IOException
It resolves "*" contained in URI, if any, to the proper Locale,
and the browser code.
Refer to Servlets.locate(javax.servlet.ServletContext, ServletRequest, String, org.zkoss.util.resource.Locator)
for details.
uri
- it must be empty or starts with "/". It might contain
"*" for current browser code and Locale.javax.servlet.ServletException
java.io.IOException
java.lang.String encodeRedirectURL(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.String uri, java.util.Map params, int mode)
javax.servlet.RequestDispatcher getRequestDispatcher(java.lang.String uri)
void include(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.String uri, java.util.Map params) throws javax.servlet.ServletException, java.io.IOException
Note: if you want to include the content into a different
writer, you have to use BufferedResponse
to 'wrap' the writer in the response.
javax.servlet.ServletException
java.io.IOException
java.net.URL getResource(java.lang.String uri)
Unlike getLocator()
, getResourceAsStream(java.lang.String)
handles the JavaScript debugging. In other words,
if the JavaScript debugging is turned on, it will try to load
the non-compressed version.
java.io.InputStream getResourceAsStream(java.lang.String uri)
Unlike getLocator()
, getResourceAsStream(java.lang.String)
handles the JavaScript debugging. In other words,
if the JavaScript debugging is turned on, it will try to load
the non-compressed version.
javax.servlet.ServletContext getServletContext()
Locator getLocator()
Unlike getResource(java.lang.String)
and getResourceAsStream(java.lang.String)
,
getLocator()
doesn't handle the JavaScript debugging.
boolean shallCompress(javax.servlet.ServletRequest request, java.lang.String ext)
It returns false if the request is included by other Servlets.
Copyright © 2005-2011 Potix Corporation. All Rights Reserved.