Interface ExtendletContext
Servlets.getRequestDispatcher(jakarta.servlet.ServletContext, jakarta.servlet.ServletRequest, java.lang.String, java.util.Map, int) will try to
resolve.
When Servlets.getRequestDispatcher(jakarta.servlet.ServletContext, jakarta.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(jakarta.servlet.ServletContext, java.lang.String, org.zkoss.web.util.resource.ExtendletContext).
- Author:
- tomyeh
-
Method Summary
Modifier and TypeMethodDescriptionencodeRedirectURL(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, String uri, Map params, int mode) Returns the encoded URL for send redirect.encodeURL(jakarta.servlet.ServletRequest request, jakarta.servlet.ServletResponse response, String uri) Returns the encoded URL.org.zkoss.util.resource.LocatorReturns the locator of this context used to locate resources.jakarta.servlet.RequestDispatchergetResource(String uri) Returns the URL of the specified URI, or null if not found.Returns the resource of the specified URI as input stream, or null if not found.jakarta.servlet.ServletContextReturns the servlet context.voidinclude(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, String uri, Map params) Includes the specified page.booleanshallCompress(jakarta.servlet.ServletRequest request, String ext) Tests whether to compress the specified extension, e.g, "js" and "css".
-
Method Details
-
encodeURL
String encodeURL(jakarta.servlet.ServletRequest request, jakarta.servlet.ServletResponse response, String uri) throws jakarta.servlet.ServletException, IOException Returns the encoded URL. The returned URL is also encoded with HttpServletResponse.encodeURL.It resolves "*" contained in URI, if any, to the proper Locale, and the browser code. Refer to
Servlets.locate(jakarta.servlet.ServletContext, ServletRequest, String, org.zkoss.util.resource.Locator)for details.- Parameters:
uri- it must be empty or starts with "/". It might contain "*" for current browser code and Locale.- Returns:
- the complete URL (excluding the machine name). It includes the context path and the servlet to interpret this extended resource.
- Throws:
jakarta.servlet.ServletExceptionIOException
-
encodeRedirectURL
String encodeRedirectURL(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, String uri, Map params, int mode) Returns the encoded URL for send redirect. The URL is also encoded with HttpServletResposne.encodeRedirectURL. -
getRequestDispatcher
-
include
void include(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, String uri, Map params) throws jakarta.servlet.ServletException, IOException Includes the specified page.Note: if you want to include the content into a different writer, you have to use
BufferedResponseto 'wrap' the writer in the response.- Throws:
jakarta.servlet.ServletExceptionIOException- Since:
- 3.5.2
-
getResource
Returns the URL of the specified URI, or null if not found.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. -
getResourceAsStream
Returns the resource of the specified URI as input stream, or null if not found.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. -
getServletContext
jakarta.servlet.ServletContext getServletContext()Returns the servlet context. -
getLocator
org.zkoss.util.resource.Locator getLocator()Returns the locator of this context used to locate resources.Unlike
getResource(java.lang.String)andgetResourceAsStream(java.lang.String),getLocator()doesn't handle the JavaScript debugging. -
shallCompress
Tests whether to compress the specified extension, e.g, "js" and "css".It returns false if the request is included by other Servlets.
-