使用此抽象类,而不是使用标准的servlet api,目的是为了尽量减少对外界api的依赖。
This class is intended for use by a single execution thread.
Abstracts access to the request information needed for file uploads. This interface should be implemented for each type of request that may be handled by FileUpload, such as servlets and portlets.
@since FileUpload 1.1 @version $Id: RequestContext.java 1455861 2013-03-13 10:12:09Z simonetripodi $null
.
RequestContext
object can be retrieved with the static {@link #getCurrentInstance} method.There is one and only one RequestContext
object active in any one thread. This class does not extend FacesContext
; this is intentional, as extending FacesContext
requires taking over the FacesContextFactory
.
@todo Refactor this class after everything gets added to it. @todo There's some values in here that seem to affect only output (e.g.,right-to-left); that's not great, since ideally that detail would be buried in something more renderer-specific. @author The Oracle ADF Faces Team @mock
Abstracts access to the request information needed for file uploads. This interface should be implemented for each type of request that may be handled by FileUpload, such as servlets and portlets.
@since FileUpload 1.1 @version $Id: RequestContext.java 1456935 2013-03-15 12:47:29Z markt $This is the base strategy for encoding URLs, which is to leave them as is. This is mainly so that PortletRequestContext can implement it's portlet encoding strategies as portlets need to have special URLs encoded with portal information and portlet namespace.
For url rewriting, only three methods are needed to support creating Portlet ActionURLs, Portlet RenderURLs and Resource/Ajax URLs. The RequestContext is somewhat comparable to the JSF ExternalContext interface which abstracts the external environment (like web or portlet) in which the application is currently running. As this is request dependent (the same application can technically be accessed even concurrently as web or portlet), in Wicket this context has been termed RequestContext. @see PortletRequestContext @author Ate Douma
Developers should note that while all the fields are declared final, the class is not completely immutable, as it exports state through the request, response, and paramters objects. When an accessor is called for one of these fields, a reference to the actual object, not to a copy, is returned.
@author Luis AntunesSuitable for exposition to views, and usage within JSP's "useBean" tag, JSP scriptlets, JSTL EL, Velocity templates, etc. Necessary for views that do not have access to the servlet request, like Velocity templates.
Can be instantiated manually, or automatically exposed to views as model attribute via AbstractView's "requestContextAttribute" property.
Will also work outside of DispatcherServlet requests, accessing the root WebApplicationContext and using an appropriate fallback for the locale (the HttpServletRequest's primary locale). @author Juergen Hoeller @since 03.03.2003 @see org.springframework.web.servlet.DispatcherServlet @see org.springframework.web.servlet.view.AbstractView#setRequestContextAttribute @see org.springframework.web.servlet.view.UrlBasedViewResolver#setRequestContextAttribute @see #getFallbackLocale()
The term request is used to describe a single call (thread) into the flow system by an external actor to manipulate exactly one flow execution.
A new instance of this object is typically created when one of the core operations supported by a flow execution is invoked, either start
to launch the flow execution, signalEvent
to resume the flow execution, or refresh
to reconstitute the flow execution's last view selection for purposes of reissuing a user response.
Once created this context object is passed around throughout flow execution request processing where it may be accessed and reasoned upon by SWF-internal artifacts such as states, user-implemented action code, and state transition criteria.
When a call into a flow execution returns this object goes out of scope and is disposed of automatically. Thus a request context is an internal artifact used within a FlowExecution: this object is not exposed to external client code, e.g. a view implementation (JSP).
The {@link #getRequestScope() requestScope} property may be used as a store for arbitrary data that should exist forthe life of this object.
The web flow system will ensure that a RequestContext object is local to the current thread. It can be safely manipulated without needing to worry about concurrent access.
Note: this request context is in no way linked to an HTTP or Portlet request. It uses the familiar "request" naming convention to indicate a single call to manipulate a runtime execution of a flow definition. @author Keith Donald @author Erwin Vervaet
It is designed to make the signature of XEL functions (see {@link org.zkoss.web.fn.ServletFns}) simpler. For example, {@link org.zkoss.web.fn.ServletFns#isExplorer} requiresno argument, since it assumes the current context can be retrieved from {@link RequestContexts#getCurrent}. @author tomyeh @since 3.0.0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|