|
Novell exteNd Director 5.2 API |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This interface provides a wrapper to one of three request implementations.
ActionRequest
RenderRequest
HttpServletRequest
The underlying request is indicated by EbiRequest.getType()
The original request can be obtained by casting for example:
EbiRequest req = ctxt.getEbiRequest(); if (req instanceofEbiRenderRequest
){ javax.portlet.RenderRequest renderRequest = ((EbiRenderRequest)req).getRenderRequest(); }
EbiRenderRequest
,
EbiActionRequest
,
EbiHttpRequest
Method Summary | |
Object |
getAttribute(String name)
Returns an object from the request attribute map with the given name, null if the name does not exist |
Cookie[] |
getCookies()
Returns an Array of Cookie objects found on the wrapped request. |
String |
getHeader(String header)
Returns an request header value, associated with the passed parameter, from the EbiRequest's HttpServletRequest. |
HttpServletRequest |
getHttpServletRequest()
Deprecated. |
Locale |
getLocale()
Returns the locale of the underlying request object, for http this relates directly to the locale header. |
Enumeration |
getLocales()
Returns the locales of the underlying request object, for http this relates directly to the locale header. |
String |
getParameter(String parameter)
Returns an request parameter value, associated with the passed parameter, from the EbiRequest's wrapped HttpServletRequest, RenderRequest, or ActionRequest. |
Enumeration |
getParameterNames()
Retrieves an enumeration of names that are contained in the request params |
String[] |
getParameterValues(String parameter)
Returns an Array of request parameter values, associated with the passed parameter, from the EbiRequest's wrapped HttpServletRequest, RenderRequest, or ActionRequest. |
String |
getPassword()
Deprecated. |
String |
getQueryString()
Deprecated. |
String |
getServer()
Try and determine the server name from the request. |
HttpSession |
getSession()
Deprecated. |
String |
getType()
the type of request that is wrapped |
String |
getUserID()
Deprecated. |
Principal |
getUserPrincipal()
gets the principal from the wrapped request implementation |
String |
getVersion()
Deprecated. |
boolean |
hasHttpServletRequest()
Checks to see if this request has an HttpServletRequest. |
boolean |
hasQueryString()
Checks to see if the HttpServletRequest has a Query String. |
boolean |
isHttpRequest()
Checks to see if the wrapped request is an HttpServletRequest. |
boolean |
isNewSession()
True if the the session from the wrapped request is a new session. |
void |
setAttribute(String name,
Object obj)
Stores an attribute in this request. |
Method Detail |
public Locale getLocale()
public Enumeration getLocales()
public HttpServletRequest getHttpServletRequest()
The wrapped request may not contain an http servlet request in which case java.lang.UnsupportedOperationException is thrown. This method is deprecated, use:
EbiRequest req = ctxt.getEbiRequest(); if (req instanceofEbiHttpRequest
){ HttpServletRequest req = ((EbiHttpRequest)req).getHttpServletRequest(); }
public Object getAttribute(String name)
name
- a String specifying the name of the attributepublic void setAttribute(String name, Object obj)
name
- a String specifying the name of the attributeobj
- the Object to be storedpublic Principal getUserPrincipal()
public String getType()
This can be used to determine the underlying request type so that a cast can be made.
For example EbiRequest#TYPE_RENDER
can be cast to (@link com.sssw.fw.api.EbiRenderRequest)
Types include: TYPE_RENDER
, TYPE_ACTION
, or TYPE_HTTP
public String getVersion()
public Cookie[] getCookies()
public String getHeader(String header)
public String getParameter(String parameter)
public String[] getParameterValues(String parameter)
public Enumeration getParameterNames()
public String getPassword()
public String getQueryString()
To get the query string from an http servlet request use:
EbiRequest req = ctxt.getEbiRequest(); if (req instanceofEbiHttpRequest
){ HttpServletRequest req = ((EbiHttpRequest)req).getHttpServletRequest(); String query = req.getQueryString(); }
public String getServer()
public HttpSession getSession()
If the wrapped request is not an HttpServletrequest java.lang.UnsupportedOperationException is thrown
Use the EbiContext.getEbiWhiteboard()
method and use the white board to set session attributes. This provides
a level of abstraction over the session.
If you absolutely need the underlying http session use:
EbiRequest req = ctxt.getEbiRequest(); if (req instanceofEbiHttpRequest
){ HttpServletRequest req = ((EbiHttpRequest)req).getHttpServletRequest(); HttpSession session = req.getSession(); }
EbiWhiteboard
,
EbiContext
public String getUserID()
You can get the user ID from the framework by using the following example:
EbiRealmUser user = EboDirectoryHelper.getEbiRealmUser(context);
EbiRealmUser
public boolean hasHttpServletRequest()
false is returned if isHttpRequest()
is false or
the httpRequest is null,
public boolean hasQueryString()
public boolean isHttpRequest()
public boolean isNewSession()
|
Novell exteNd Director 5.2 API |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |