| org.zkoss.zk.ui.Execution
All known Subclasses: org.zkoss.zk.ui.impl.AbstractExecution,
Execution | public interface Execution (Code) | | An execution of a client request (e.g., ServletRequest).
When a request sent from a client, the server constructs
a
Execution object to hold execution relevant info, and then serves the request
thru this execution.
A client request, e.g., HttpServletRequest, might consist of
multiple ZK request (
org.zkoss.zk.au.AuRequest ).
However, these ZK requests
must target the same desktop of pages (
Page ).
Because a request might come from HTTP or other protocol, Execution
also serves as an isolation layer.
author: tomyeh See Also: Page |
Field Summary | |
final public static int | APPEND_PARAM Whether to append params if both uri and params contain the same
parameter. | final public static int | IGNORE_PARAM Whether to ignore params if both uri and params contain the same
parameter. | final public static int | OVERWRITE_URI Whether to overwrite uri if both uri and params contain the same
parameter. | final public static int | PASS_THRU_ATTR Whether the specified parameters shall be passed thru the request's
attribute called arg. |
Method Summary | |
public void | addAuResponse(String key, AuResponse resposne) Adds an asynchronous response (
AuResponse ) which will be
sent to client at the end of the execution.
If
AuResponse.getDepends is not null, the response
depends on the returned componet. | public Component | createComponents(PageDefinition pagedef, Component parent, Map arg) Creates components from the specified page definition.
The created components become the child of the specified parent,
or become the root components of the current page if parent is specified
as null.
Parameters: pagedef - the page definition to use. | public Component | createComponents(String uri, Component parent, Map arg) Creates components from a page file specified by an URI.
The created components become the child of the specified parent,
or become the root components of the current page if parent is specified
as null.
It loads the page definition from the specified URI (by
use
Execution.getPageDefinition ), and then
invokes
Execution.createComponents(PageDefinition,Component,Map) to create components.
Parameters: parent - the parent component, or null if you want it to bea root component. | public Component[] | createComponents(PageDefinition pagedef, Map arg) Creates components that don't belong to any page
from the specified page definition.
Parameters: pagedef - the page definition to use. | public Component[] | createComponents(String uri, Map arg) Creates components that don't belong to any page
from a page file specified by an URI. | public Component | createComponentsDirectly(String content, String extension, Component parent, Map arg) Creates components from the raw content specified by a string.
The created components become the child of the specified parent,
or become the root components of the current page if parent is specified
as null.
The raw content is parsed to a page defintion by use of
Execution.getPageDefinitionDirectly(String,String) , and then
invokes
Execution.createComponents(PageDefinition,Component,Map) to create components.
Parameters: content - the raw content of the page. | public Component | createComponentsDirectly(Document content, String extension, Component parent, Map arg) Creates components from the raw content specified by a DOM tree.
The created components become the child of the specified parent,
or become the root components of the current page if parent is specified
as null.
The raw content is parsed to a page defintion by use of
Execution.getPageDefinitionDirectly(Document,String) , and then
invokes
Execution.createComponents(PageDefinition,Component,Map) to create components.
Parameters: content - the raw content in DOM. Parameters: extension - the default extension if the content doesn't specifyan language. | public Component | createComponentsDirectly(Reader reader, String extension, Component parent, Map arg) Creates components from the raw content read from the specified reader.
The created components become the child of the specified parent,
or become the root components of the current page if parent is specified
as null.
The raw content is loaded and parsed to a page defintion by use of
Execution.getPageDefinitionDirectly(Reader,String) , and then
invokes
Execution.createComponents(PageDefinition,Component,Map) to create components.
Parameters: reader - the reader to retrieve the raw content in ZUML. Parameters: extension - the default extension if the content doesn't specifyan language. | public Component[] | createComponentsDirectly(String content, String extension, Map arg) Creates components that don't belong to any page
from the raw content specified by a string.
The raw content is parsed to a page defintion by use of
Execution.getPageDefinitionDirectly(String,String) , and then
invokes
Execution.createComponents(PageDefinition,Component,Map) to create components.
Parameters: content - the raw content of the page. | public Component[] | createComponentsDirectly(Document content, String extension, Map arg) Creates components that don't belong to any page
from the raw content specified by a DOM tree.
The raw content is parsed to a page defintion by use of
Execution.getPageDefinitionDirectly(Document,String) , and then
invokes
Execution.createComponents(PageDefinition,Component,Map) to create components.
Parameters: content - the raw content in DOM. Parameters: extension - the default extension if the content doesn't specifyan language. | public Component[] | createComponentsDirectly(Reader reader, String extension, Map arg) Creates components that don't belong to any page
from the raw content read from the specified reader.
The raw content is loaded and parsed to a page defintion by use of
Execution.getPageDefinitionDirectly(Reader,String) , and then
invokes
Execution.createComponents(PageDefinition,Component,Map) to create components.
Parameters: reader - the reader to retrieve the raw content in ZUML. Parameters: extension - the default extension if the content doesn't specifyan language. | public String | encodeURL(String uri) Encodes an URL.
It resolves "*" contained in URI, if any, to the proper Locale,
and the browser code.
Refer to
Servlets.locate(ServletContextServletRequestStringLocator) for details. | public Object | evaluate(Component comp, String expr, Class expectedType) Evluates the specified expression with ${link #getVariableResolver}
and
Page.getFunctionMapper of the page of the specified
component.
The function mapper is retrieved from component's page's function
mapper (
Page.getFunctionMapper ).
If null, the current page, if any, is used to retrieve
the mapper.
For better performance, you can use the instance returned by
Execution.getEvaluator to parse and cached the parsed expression.
org.zkoss.zk.xel.ExValue is a utility class to simply
the task.
Parameters: comp - used as the self variable and to retrieve the functionmapper. | public Object | evaluate(Page page, String expr, Class expectedType) Evluates the specified expression with ${link #getVariableResolver}
and
Page.getFunctionMapper of the specified
page.
The function mapper is retrieved from component's page's function
mapper (
Page.getFunctionMapper ).
If null, the current page, if any, is used to retrieve
the mapper.
For better performance, you can use the instance returned by
Execution.getEvaluator to parse and cached the parsed expression.
org.zkoss.zk.xel.ExValue is a utility class to simply
the task.
Parameters: page - used as the self variable and to retrieve the functionmapper. | public void | forward(Writer writer, String page, Map params, int mode) Forwards to another page.
Note: this method can be called only when loading a page.
Use
Execution.sendRedirect(String) instead if you want to change
to another desktop when processing a request from the client.
Parameters: writer - the output to write. | public void | forward(String page) A shortcut of forward(null, page, null, 0). | public Map | getArg() Returns the parameters (aka., arg) if
Execution.pushArg is called recently,
or an empty map if not available.
The use of parameters is application dependent.
ZK only provides the way to store (
Execution.pushArg and to
restore
Execution.popArg . | public Object | getAttribute(String name) Returns the value of the specified request attribute. | public Map | getAttributes() Returns a map of request attributes associated with this session. | public String | getContextPath() Returns the portion of the request URI that indicates the context of
the current execution. | public Desktop | getDesktop() Returns the desktop for this execution. | public Evaluator | getEvaluator(Page page, Class expfcls) Returns the evaluator (never null). | public Evaluator | getEvaluator(Component comp, Class expfcls) Returns the evaluator of the current execution. | public String | getLocalAddr() Returns the Internet Protocol (IP) address of the interface on which
the request was received. | public String | getLocalName() Returns the host name of the Internet Protocol (IP) interface
on which the request was received.
Note: it is the host name defined in the server. | public int | getLocalPort() Returns the Internet Protocol (IP) port number of the interface on which
the request was received. | public Object | getNativeRequest() Returns the native request, or null if not available. | public Object | getNativeResponse() Returns the native response, or null if not available. | public PageDefinition | getPageDefinition(String uri) Returns the page definition from the page file specified by an URI. | public PageDefinition | getPageDefinitionDirectly(String content, String extension) Converts the specified page content to a page definition.
Implemetation Notes: this method must invoke
org.zkoss.zk.ui.sys.UiFactory.getPageDefinitionDirectly(org.zkoss.zk.ui.sys.RequestInfoStringString) Parameters: content - the raw content of the page. | public PageDefinition | getPageDefinitionDirectly(Document content, String extension) Converts the specified page content, in DOM, to a page definition.
Parameters: content - the raw content of the page in DOM. Parameters: extension - the default extension if the content doesn't specifyan language. | public PageDefinition | getPageDefinitionDirectly(Reader reader, String extension) Reads the raw content from a reader and converts it into
a page definition.
Parameters: reader - used to input the raw content of the page. | public String | getParameter(String name) | public Map | getParameterMap() Returns a Map of the parameters of this request. | public String[] | getParameterValues(String name) Returns an array of String objects containing all of the values
the given request parameter has, or null if the parameter does not exist. | public String | getRemoteAddr() Returns the Internet Protocol (IP) address of the client or last
proxy that sent the request. | public String | getRemoteHost() Returns the fully qualified name of the client or the last proxy
that sent the request. | public String | getRemoteName() | public String | getRemoteUser() Returns the login of the user making this request, if the user has
been authenticated, or null if the user has not been authenticated. | public String | getServerName() Returns the host name of the server to which the request was sent. | public int | getServerPort() Returns the port number to which the request was sent. | public String | getUserAgent() Returns the user-agent header, which indicates what the client is,
or an empty string if not available. | public Principal | getUserPrincipal() Returns a java.security.Principal object containing the name of the
current authenticated user. | public VariableResolver | getVariableResolver() Returns the variable resolver for this execution, or null if not
available. | public void | include(Writer writer, String page, Map params, int mode) Includes a page.
Parameters: writer - the output to write. | public void | include(String page) A shortcut of include(null, page, null, 0). | public boolean | isAsyncUpdate(Page page) Returns whether this execution is asynchronous updating the
specified page (thru ZK Update Engine). | public boolean | isBrowser() Returns whether the client is a browser. | public boolean | isExplorer() Returns whether the client is Internet Explorer. | public boolean | isExplorer7() Returns whether the client is Internet Explorer 7 or later. | public boolean | isForwarded() Returns whether the execution is forwarded from other pages. | public boolean | isGecko() Returns whether the client is Gecko based, such as Mozilla, Firefox and Camino. | public boolean | isHilDevice() Returns whether the client is a mobile device supporting HIL
(Handset Interactive Language). | public boolean | isIncluded() Returns whether this execution is included by some other pages. | public boolean | isMilDevice() Returns whether the client is a mobile device supporting MIL
(Mobile Interactive Language). | public boolean | isRobot() Returns whether the client is a robot (such as Web crawlers). | public boolean | isSafari() Returns whether the client is Safari. | public boolean | isUserInRole(String role) Returns a boolean indicating whether the authenticated user is
included in the specified logical "role". | public boolean | isVoided() Returns whether the execution is voided.
By void we mean the request is taken charged by other servlet.
The execution shall not do anything more. | public void | popArg() Pops the parameters (aka., arg) that is pushed by
Execution.pushArg . | public void | postEvent(Event evt) Queues an event to the current execution. | public void | pushArg(Map arg) Pushes the parameters (aka., arg) that EL could refer it by the arg variable. | public void | removeAttribute(String name) Removes the specified request attribute. | public void | sendRedirect(String uri) Sends a temporary redirect response to the client using the specified
redirect location URL.
It is the same as sendRedirect(url, null).
After calling this method, the caller shall end the processing
immediately (by returning). | public void | sendRedirect(String uri, String target) Sends a temporary redirect response to the client using the specified
redirect location URL and redirect to the specified browser window.
After calling this method, the caller shall end the processing
immediately (by returning). | public void | setAttribute(String name, Object value) Sets the value of the specified request attribute.
Parameters: value - the value. | public void | setVoided(boolean voided) Sets whether the execution is voided.
By void we mean the request is taken charged by other servlet.
If you invoke
Execution.forward , this method is called automatically
with true. | public String | toAbsoluteURI(String uri, boolean skipInclude) Converts the specified URI to an absolute URI, if uri is related
and the current execution is not included (
Execution.isIncluded ). |
APPEND_PARAM | final public static int APPEND_PARAM(Code) | | Whether to append params if both uri and params contain the same
parameter. In other words, they both appear as the final query string.
|
IGNORE_PARAM | final public static int IGNORE_PARAM(Code) | | Whether to ignore params if both uri and params contain the same
parameter.
|
OVERWRITE_URI | final public static int OVERWRITE_URI(Code) | | Whether to overwrite uri if both uri and params contain the same
parameter.
|
PASS_THRU_ATTR | final public static int PASS_THRU_ATTR(Code) | | Whether the specified parameters shall be passed thru the request's
attribute called arg.
|
addAuResponse | public void addAuResponse(String key, AuResponse resposne)(Code) | | Adds an asynchronous response (
AuResponse ) which will be
sent to client at the end of the execution.
If
AuResponse.getDepends is not null, the response
depends on the returned componet. In other words, the response
is removed if the component is removed.
If it is null, the response is component-independent.
Parameters: key - could be anything. The second invocation of this methodin the same execution with the same key will override the previous one. |
createComponents | public Component createComponents(PageDefinition pagedef, Component parent, Map arg)(Code) | | Creates components from the specified page definition.
The created components become the child of the specified parent,
or become the root components of the current page if parent is specified
as null.
Parameters: pagedef - the page definition to use. It cannot be null. Parameters: parent - the parent component, or null if you want it to bea root component. If parent is null, the page is assumed to bethe current page, which is determined by the execution context. Parameters: arg - a map of parameters that is accessible by the arg variablein EL, or by Execution.getArg.Ignored if null. the first component being created. See Also: Execution.createComponents(String,Component,Map) |
createComponents | public Component createComponents(String uri, Component parent, Map arg)(Code) | | Creates components from a page file specified by an URI.
The created components become the child of the specified parent,
or become the root components of the current page if parent is specified
as null.
It loads the page definition from the specified URI (by
use
Execution.getPageDefinition ), and then
invokes
Execution.createComponents(PageDefinition,Component,Map) to create components.
Parameters: parent - the parent component, or null if you want it to bea root component. If parent is null, the page is assumed to bethe current page, which is determined by the execution context. Parameters: arg - a map of parameters that is accessible by the arg variablein EL, or by Execution.getArg.Ignored if null. See Also: Execution.createComponents(PageDefinition,Component,Map) See Also: Execution.createComponentsDirectly(String,String,Component,Map) See Also: Execution.createComponentsDirectly(Document,String,Component,Map) See Also: Execution.createComponentsDirectly(Reader,String,Component,Map) |
createComponents | public Component[] createComponents(PageDefinition pagedef, Map arg)(Code) | | Creates components that don't belong to any page
from the specified page definition.
Parameters: pagedef - the page definition to use. It cannot be null. Parameters: arg - a map of parameters that is accessible by the arg variablein EL, or by Execution.getArg.Ignored if null. the first component being created. See Also: Execution.createComponents(String,Map) since: 2.4.0 |
createComponents | public Component[] createComponents(String uri, Map arg)(Code) | | Creates components that don't belong to any page
from a page file specified by an URI.
It loads the page definition from the specified URI (by
use
Execution.getPageDefinition ), and then
invokes
Execution.createComponents(PageDefinition,Component,Map) to create components.
Parameters: arg - a map of parameters that is accessible by the arg variablein EL, or by Execution.getArg.Ignored if null. See Also: Execution.createComponents(PageDefinition,Map) See Also: Execution.createComponentsDirectly(String,String,Map) See Also: Execution.createComponentsDirectly(Document,String,Map) See Also: Execution.createComponentsDirectly(Reader,String,Map) since: 2.4.0 |
createComponentsDirectly | public Component createComponentsDirectly(String content, String extension, Component parent, Map arg)(Code) | | Creates components from the raw content specified by a string.
The created components become the child of the specified parent,
or become the root components of the current page if parent is specified
as null.
The raw content is parsed to a page defintion by use of
Execution.getPageDefinitionDirectly(String,String) , and then
invokes
Execution.createComponents(PageDefinition,Component,Map) to create components.
Parameters: content - the raw content of the page. It must be in ZUML. Parameters: extension - the default extension if the content doesn't specifyan language. In other words, ifthe content doesn't specify an language, LanguageDefinition.getByExtensionis called.If extension is null and the content doesn't specify a language,the language called "xul/html" is assumed. Parameters: parent - the parent component, or null if you want it to bea root component. If parent is null, the page is assumed to bethe current page, which is determined by the execution context. Parameters: arg - a map of parameters that is accessible by the arg variablein EL, or by Execution.getArg.Ignored if null. See Also: Execution.createComponents(PageDefinition,Component,Map) See Also: Execution.createComponents(String,Component,Map) See Also: Execution.createComponentsDirectly(Document,String,Component,Map) See Also: Execution.createComponentsDirectly(Reader,String,Component,Map) |
createComponentsDirectly | public Component createComponentsDirectly(Document content, String extension, Component parent, Map arg)(Code) | | Creates components from the raw content specified by a DOM tree.
The created components become the child of the specified parent,
or become the root components of the current page if parent is specified
as null.
The raw content is parsed to a page defintion by use of
Execution.getPageDefinitionDirectly(Document,String) , and then
invokes
Execution.createComponents(PageDefinition,Component,Map) to create components.
Parameters: content - the raw content in DOM. Parameters: extension - the default extension if the content doesn't specifyan language. In other words, ifthe content doesn't specify an language, LanguageDefinition.getByExtensionis called.If extension is null and the content doesn't specify a language,the language called "xul/html" is assumed. Parameters: parent - the parent component, or null if you want it to bea root component. If parent is null, the page is assumed to bethe current page, which is determined by the execution context. Parameters: arg - a map of parameters that is accessible by the arg variablein EL, or by Execution.getArg.Ignored if null. See Also: Execution.createComponents(PageDefinition,Component,Map) See Also: Execution.createComponents(String,Component,Map) See Also: Execution.createComponentsDirectly(Document,String,Component,Map) See Also: Execution.createComponentsDirectly(Reader,String,Component,Map) |
createComponentsDirectly | public Component createComponentsDirectly(Reader reader, String extension, Component parent, Map arg) throws IOException(Code) | | Creates components from the raw content read from the specified reader.
The created components become the child of the specified parent,
or become the root components of the current page if parent is specified
as null.
The raw content is loaded and parsed to a page defintion by use of
Execution.getPageDefinitionDirectly(Reader,String) , and then
invokes
Execution.createComponents(PageDefinition,Component,Map) to create components.
Parameters: reader - the reader to retrieve the raw content in ZUML. Parameters: extension - the default extension if the content doesn't specifyan language. In other words, ifthe content doesn't specify an language, LanguageDefinition.getByExtensionis called.If extension is null and the content doesn't specify a language,the language called "xul/html" is assumed. Parameters: parent - the parent component, or null if you want it to bea root component. If parent is null, the page is assumed to bethe current page, which is determined by the execution context. Parameters: arg - a map of parameters that is accessible by the arg variablein EL, or by Execution.getArg.Ignored if null. See Also: Execution.createComponents(PageDefinition,Component,Map) See Also: Execution.createComponents(String,Component,Map) See Also: Execution.createComponentsDirectly(Document,String,Component,Map) See Also: Execution.createComponentsDirectly(String,String,Component,Map) |
createComponentsDirectly | public Component[] createComponentsDirectly(String content, String extension, Map arg)(Code) | | Creates components that don't belong to any page
from the raw content specified by a string.
The raw content is parsed to a page defintion by use of
Execution.getPageDefinitionDirectly(String,String) , and then
invokes
Execution.createComponents(PageDefinition,Component,Map) to create components.
Parameters: content - the raw content of the page. It must be in ZUML. Parameters: extension - the default extension if the content doesn't specifyan language. In other words, ifthe content doesn't specify an language, LanguageDefinition.getByExtensionis called.If extension is null and the content doesn't specify a language,the language called "xul/html" is assumed. Parameters: arg - a map of parameters that is accessible by the arg variablein EL, or by Execution.getArg.Ignored if null. See Also: Execution.createComponents(PageDefinition,Map) See Also: Execution.createComponents(String,Map) See Also: Execution.createComponentsDirectly(Document,String,Map) See Also: Execution.createComponentsDirectly(Reader,String,Map) since: 2.4.0 |
createComponentsDirectly | public Component[] createComponentsDirectly(Document content, String extension, Map arg)(Code) | | Creates components that don't belong to any page
from the raw content specified by a DOM tree.
The raw content is parsed to a page defintion by use of
Execution.getPageDefinitionDirectly(Document,String) , and then
invokes
Execution.createComponents(PageDefinition,Component,Map) to create components.
Parameters: content - the raw content in DOM. Parameters: extension - the default extension if the content doesn't specifyan language. In other words, ifthe content doesn't specify an language, LanguageDefinition.getByExtensionis called.If extension is null and the content doesn't specify a language,the language called "xul/html" is assumed. Parameters: arg - a map of parameters that is accessible by the arg variablein EL, or by Execution.getArg.Ignored if null. See Also: Execution.createComponents(PageDefinition,Map) See Also: Execution.createComponents(String,Map) See Also: Execution.createComponentsDirectly(Document,String,Map) See Also: Execution.createComponentsDirectly(Reader,String,Map) since: 2.4.0 |
createComponentsDirectly | public Component[] createComponentsDirectly(Reader reader, String extension, Map arg) throws IOException(Code) | | Creates components that don't belong to any page
from the raw content read from the specified reader.
The raw content is loaded and parsed to a page defintion by use of
Execution.getPageDefinitionDirectly(Reader,String) , and then
invokes
Execution.createComponents(PageDefinition,Component,Map) to create components.
Parameters: reader - the reader to retrieve the raw content in ZUML. Parameters: extension - the default extension if the content doesn't specifyan language. In other words, ifthe content doesn't specify an language, LanguageDefinition.getByExtensionis called.If extension is null and the content doesn't specify a language,the language called "xul/html" is assumed. Parameters: arg - a map of parameters that is accessible by the arg variablein EL, or by Execution.getArg.Ignored if null. See Also: Execution.createComponents(PageDefinition,Map) See Also: Execution.createComponents(String,Map) See Also: Execution.createComponentsDirectly(Document,String,Map) See Also: Execution.createComponentsDirectly(String,String,Map) since: 2.4.0 |
getArg | public Map getArg()(Code) | | Returns the parameters (aka., arg) if
Execution.pushArg is called recently,
or an empty map if not available.
The use of parameters is application dependent.
ZK only provides the way to store (
Execution.pushArg and to
restore
Execution.popArg . And, let the parameters being accessible in
EL by referring it as the arg variable.
Currently,
Execution.createComponents(String,Component,Map) and similar methods use this mechanism to let caller customize a page
definition.
Notice that
Execution.createComponents(String,Component,Map) pops arg after creating components, and before processing any event.
In other words, it is not aviable for event listener, including onCreate.
However,
org.zkoss.zk.ui.event.CreateEvent.getArg preserves
the map for its event listeners.
|
getAttribute | public Object getAttribute(String name)(Code) | | Returns the value of the specified request attribute.
|
getAttributes | public Map getAttributes()(Code) | | Returns a map of request attributes associated with this session.
|
getContextPath | public String getContextPath()(Code) | | Returns the portion of the request URI that indicates the context of
the current execution. The path starts with a "/" character but does not end with
a "/" character. For servlets in the default (root) context,
this method returns "".
If the client is not using HTTP to access, this method return "";
See Also: Page.getRequestPath |
getDesktop | public Desktop getDesktop()(Code) | | Returns the desktop for this execution.
Each execution is against exactly one desktop.
|
getLocalAddr | public String getLocalAddr()(Code) | | Returns the Internet Protocol (IP) address of the interface on which
the request was received.
|
getLocalPort | public int getLocalPort()(Code) | | Returns the Internet Protocol (IP) port number of the interface on which
the request was received.
See Also: Execution.getServerPort |
getNativeRequest | public Object getNativeRequest()(Code) | | Returns the native request, or null if not available.
The returned object depends on the Web container.
If it is based Java servlet container, an instance of
javax.servlet.ServletRequest is returned.
|
getNativeResponse | public Object getNativeResponse()(Code) | | Returns the native response, or null if not available.
The returned object depends on the Web container.
If it is based Java servlet container, an instance of
javax.servlet.ServletResponse is returned.
|
getParameter | public String getParameter(String name)(Code) | | Returns the value of a request parameter as a String,
or null if the parameter does not exist
|
getParameterMap | public Map getParameterMap()(Code) | | Returns a Map of the parameters of this request.
Request parameters are extra information sent with the request.
|
getParameterValues | public String[] getParameterValues(String name)(Code) | | Returns an array of String objects containing all of the values
the given request parameter has, or null if the parameter does not exist.
|
getRemoteAddr | public String getRemoteAddr()(Code) | | Returns the Internet Protocol (IP) address of the client or last
proxy that sent the request.
|
getRemoteHost | public String getRemoteHost()(Code) | | Returns the fully qualified name of the client or the last proxy
that sent the request.
If the engine cannot or chooses not to resolve the hostname
(to improve performance), this method returns the dotted-string form of
the IP address.
|
getRemoteUser | public String getRemoteUser()(Code) | | Returns the login of the user making this request, if the user has
been authenticated, or null if the user has not been authenticated.
Whether the user name is sent with each subsequent request depends on
the browser and type of authentication.
|
getServerName | public String getServerName()(Code) | | Returns the host name of the server to which the request was sent.
It is the value of the part before ":" in the Host header value, if any,
or the resolved server name, or the server IP address.
See Also: Execution.getLocalName |
getServerPort | public int getServerPort()(Code) | | Returns the port number to which the request was sent.
It is the value of the part after ":" in the Host header value, if any,
or the server port where the client connection was accepted on.
See Also: Execution.getLocalPort |
getUserAgent | public String getUserAgent()(Code) | | Returns the user-agent header, which indicates what the client is,
or an empty string if not available.
Note: it doesn't return null, so it is easy to test what
the client is with
String.indexOf .
since: 3.0.2 |
getUserPrincipal | public Principal getUserPrincipal()(Code) | | Returns a java.security.Principal object containing the name of the
current authenticated user.
If the user has not been authenticated, the method returns null.
|
isAsyncUpdate | public boolean isAsyncUpdate(Page page)(Code) | | Returns whether this execution is asynchronous updating the
specified page (thru ZK Update Engine).
whether the specified page is being asynchronous updatedby this execution.If the specified page is null, this method returnswhether this execution is asynchronous updating a page(rather than creating/loading a new page).Each execution remembers the page being creating.All other pages are consided as being asynchronous updated. |
isBrowser | public boolean isBrowser()(Code) | | Returns whether the client is a browser.
|
isExplorer | public boolean isExplorer()(Code) | | Returns whether the client is Internet Explorer.
If true, it also implies
Execution.isExplorer7 is true.
|
isExplorer7 | public boolean isExplorer7()(Code) | | Returns whether the client is Internet Explorer 7 or later.
|
isForwarded | public boolean isForwarded()(Code) | | Returns whether the execution is forwarded from other pages.
since: 2.4.0 |
isGecko | public boolean isGecko()(Code) | | Returns whether the client is Gecko based, such as Mozilla, Firefox and Camino.
|
isHilDevice | public boolean isHilDevice()(Code) | | Returns whether the client is a mobile device supporting HIL
(Handset Interactive Language).
Note: ZK Mobile for Android supports both MIL and HIL.
That is, both
Execution.isHilDevice and
Execution.isMilDevice return true.
since: 3.0.2 |
isIncluded | public boolean isIncluded()(Code) | | Returns whether this execution is included by some other pages.
|
isMilDevice | public boolean isMilDevice()(Code) | | Returns whether the client is a mobile device supporting MIL
(Mobile Interactive Language).
since: 2.4.1 |
isRobot | public boolean isRobot()(Code) | | Returns whether the client is a robot (such as Web crawlers).
Because there are too many robots, it returns true if the user-agent
is not recognized.
|
isSafari | public boolean isSafari()(Code) | | Returns whether the client is Safari.
|
isUserInRole | public boolean isUserInRole(String role)(Code) | | Returns a boolean indicating whether the authenticated user is
included in the specified logical "role". Roles and role membership
can be defined using deployment descriptors.
If the user has not been authenticated, the method returns false.
Parameters: role - a String specifying the name of the role |
isVoided | public boolean isVoided()(Code) | | Returns whether the execution is voided.
By void we mean the request is taken charged by other servlet.
The execution shall not do anything more. In other words,
the execution is avoided and won't generate any ouput.
The common cause of being voided is the invocation of
Execution.forward .
since: 2.4.0 |
postEvent | public void postEvent(Event evt)(Code) | | Queues an event to the current execution.
The event is placed at the end of the event queue.
It will be processed after all other events are processed.
|
removeAttribute | public void removeAttribute(String name)(Code) | | Removes the specified request attribute.
|
sendRedirect | public void sendRedirect(String uri)(Code) | | Sends a temporary redirect response to the client using the specified
redirect location URL.
It is the same as sendRedirect(url, null).
After calling this method, the caller shall end the processing
immediately (by returning). All pending requests and events will
be dropped.
Parameters: uri - the URI to redirect to, or null to reload the same page |
sendRedirect | public void sendRedirect(String uri, String target)(Code) | | Sends a temporary redirect response to the client using the specified
redirect location URL and redirect to the specified browser window.
After calling this method, the caller shall end the processing
immediately (by returning). All pending requests and events will
be dropped.
Note: if you specify target other than null and "_self", it'll
fail if the browser prevent the server to popup a window.
Parameters: uri - the URI to redirect to, or null to reload the same page Parameters: target - the name of the browser window that send-redirect willload the sepcified URI, or null if the current browser windowis used. |
setAttribute | public void setAttribute(String name, Object value)(Code) | | Sets the value of the specified request attribute.
Parameters: value - the value. If null, the attribute is removed. |
setVoided | public void setVoided(boolean voided)(Code) | | Sets whether the execution is voided.
By void we mean the request is taken charged by other servlet.
If you invoke
Execution.forward , this method is called automatically
with true. Thus, you rarely need to invoke this method, unless
you forward to other servlet by use javax.servlet.RequestDispatcher
directly.
since: 2.4.1 |
toAbsoluteURI | public String toAbsoluteURI(String uri, boolean skipInclude)(Code) | | Converts the specified URI to an absolute URI, if uri is related
and the current execution is not included (
Execution.isIncluded ).
Note: an asynchrous update is processed by the update servlet.
It is different from the servlet for rendering the ZUML page.
In other words, a relative URI won't be interpreted correctly,
so you have to invoke this method to convert them if necessary.
In addtions, RequestDispatcher.include doesn't handle related URI
well.
Parameters: skipInclude - whether not to convert to an absolute URI ifthe current page is included by another page.If you are not sure, you might specify false. |
|
|