|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.wicket.RequestContext
public class RequestContext
Handles url rewriting, provides access to the namespace for markup Ids and isolated session state.
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.
PortletRequestContext
Constructor Summary | |
---|---|
RequestContext()
Construct. |
Method Summary | |
---|---|
CharSequence |
encodeActionURL(CharSequence path)
Encodes URL's for action URLs, typically overridden by the portlet implementation. |
String |
encodeMarkupId(String markupId)
Encodes markup Ids, typically overridden by the portlet implementation. |
CharSequence |
encodeRenderURL(CharSequence path)
Encodes URL's for render URLs, typically overridden by the portlet implementation. |
CharSequence |
encodeResourceURL(CharSequence path)
Encodes URL's for resource targets, typically overridden by the portlet implementation. |
CharSequence |
encodeSharedResourceURL(CharSequence path)
Encodes URL's for shared resource targets, typically overridden by the portlet implementation. |
static RequestContext |
get()
|
IHeaderResponse |
getHeaderResponse()
Used to override response objects, typically used by the portlet implementation. |
CharSequence |
getNamespace()
|
boolean |
isPortletRequest()
|
protected static void |
set(RequestContext context)
Sets the RequestContext for the current threads active request. |
static void |
unset()
Resets the RequestContext for the current threads active request. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RequestContext()
Method Detail |
---|
public static final RequestContext get()
public static final void unset()
RequestContext
for the current threads active request.
protected static final void set(RequestContext context)
RequestContext
for the current threads active request.
context
- public CharSequence getNamespace()
PortletRequestContext.getNamespace()
public String encodeMarkupId(String markupId)
markupId
- the markup Id to encode
PortletRequestContext.encodeMarkupId(String)
public CharSequence encodeActionURL(CharSequence path)
path
- the URL to encode
PortletRequestContext.encodeActionURL(CharSequence)
public CharSequence encodeRenderURL(CharSequence path)
path
- the URL to encode
PortletRequestContext.encodeRenderURL(CharSequence)
public CharSequence encodeResourceURL(CharSequence path)
path
- the URL to encode
PortletRequestContext.encodeResourceURL(CharSequence)
public CharSequence encodeSharedResourceURL(CharSequence path)
path
- the URL to encode
ISharedResourceRequestTarget
,
PortletRequestContext.encodeSharedResourceURL(CharSequence)
public IHeaderResponse getHeaderResponse()
In a Portlet environment, this allows the portlet container/portal to capture the HeaderResponse as a separate stream for merging in the overall page header (together with header output for other portlets).
PortletRequestContext.getHeaderResponse()
public boolean isPortletRequest()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |