Package org.zkoss.web.servlet.dsp
Interface DspContext
- All Superinterfaces:
RequestContext
- All Known Implementing Classes:
ExtendletDspContext,ServletDspContext
The context used with
Interpreter.interpret(org.zkoss.web.servlet.dsp.DspContext, java.lang.String, java.lang.String, org.zkoss.xel.XelContext).- Author:
- tomyeh
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionReturns the encoded URL.org.zkoss.util.resource.LocatorReturns the locator for loading resources, such as taglib.voidIncludes the specified URI and render the result to the specified output.booleanReturns whether this page is included.voidsetContentType(String ctype) Sets the content type of the output.voidChanges the writer of this context to the specified one.Methods inherited from interface org.zkoss.web.servlet.xel.RequestContext
getOut, getRequest, getResponse, getServletContext, getVariableResolver
-
Method Details
-
getLocator
org.zkoss.util.resource.Locator getLocator()Returns the locator for loading resources, such as taglib. You might return null if the page not referencing external resources.To load the resource from a web application, use
ServletContextLocatorTo load the resource from class path, use org.zkoss.util.resource.Resources.getDefault(). -
setContentType
Sets the content type of the output. -
encodeURL
Returns the encoded URL. The returned URL is also encoded with HttpServletResponse.encodeURL.- 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- Since:
- 3.5.2
-
include
Includes the specified URI and render the result to the specified output.- Parameters:
uri- the URI to include. It is OK to relevant (without leading '/'). If starts with "/", the context path of request is assumed. To reference to foreign context, use "~ctx/" where ctx is the context path of the foreign context (without leading '/').params- a map of parameters, or null to ignore. The map is passed thru the request attribute called arg.- Throws:
jakarta.servlet.ServletExceptionIOException- Since:
- 3.5.2
-
isIncluded
boolean isIncluded()Returns whether this page is included.- Since:
- 3.5.2
-
setOut
Changes the writer of this context to the specified one.- Parameters:
out- the new writer. If null, it is restored to the default one.
-