|
Novell exteNd Director 5.2 API |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Interface for examining request information passed by a component. Methods examine and set cookies, response status, response phrase, and servlet context.
In a component's getComponentData() method, your code builds the HTML or XML for the component's user interface. Then it calls the setContentType() and setComponentContent() methods to send the content back to the Presentation Manager.
Method Summary | |
String |
getContentType()
Gets the type of content being returned by a component. |
String |
getCookieValue(String cookieID)
Gets the value associated with a particular cookie ID. |
String |
getResponsePhrase()
Gets a piece of content or other text that was set in the context object by a component or a rule's action. |
int |
getResponseStatus()
Gets the status code associated with the response. |
ServletContext |
getServletContext()
Gets the servlet context. |
String |
getURI()
Gets the URI of the current context. |
boolean |
hasQueryString()
Checks the request for a parameter string associated with an HTTP request. |
void |
setContentType(String contentType)
Sets the type of content being returned to the portal by a component. |
void |
setCookieValue(String cookieID,
String cookieValue,
int maxAge)
Sets a cookie in the user's browser. |
void |
setRequestResponse(HttpServletRequest req,
HttpServletResponse res)
Sets both the request and the response objects in the context. |
void |
setResponsePhrase(String phrase)
Sets a piece of text in the context object. |
void |
setResponseStatus(int status)
Sets the status code associated with the response. |
void |
setServletContext(ServletContext scontext)
Sets the current Servlet context. |
void |
setURI(String uri)
Sets URI of the current context. |
Methods implemented from interface com.sssw.fw.api.EbiContext |
cloneCopy,
getAttributeNames,
getBrowserInfo,
getContextName,
getEbiRequest,
getEbiResponse,
getEbiSession,
getEbiSession,
getEbiWhiteboard,
getEJBContext,
getException,
getLocale,
getPrincipal,
getTemporaryData,
getTemporaryValue,
getValue,
getValue,
getValueNames,
hasSession,
hasValue,
isNewSession,
removeAllValues,
removeValue,
setEbiRequest,
setEbiResponse,
setEbiSession,
setEJBContext,
setException,
setTemporaryValue,
setValue |
Method Detail |
public String getContentType()
EbiComponentConstants
.
EbiRequestContext.setContentType(String)
public void setContentType(String contentType)
The types of content typically are HTML or XML.
The XML can be returned as a DOM or String.
Constants for content types have the prefix MIME and are defined in
EbiComponentConstants
.
EbiRequestContext.getContentType()
,
EbiComponentConstants.MIME_TYPE_HTML
,
EbiComponentConstants.MIME_TYPE_XML
,
EbiComponentConstants.MIME_TYPE_XMLDOM
public String getResponsePhrase()
A response phrase is available if the component runs a rule or calls other code that sets the phrase. For rules and actions, check the documentation to find out what their effects are.
To find out the format of the response phrase, check the response type
by calling EbiResponse.getResponseType()
.
The response phrase is available whenever a context object exists, but it is not used directly by the portal. It is up to your component's code to fire rules, get the response phrase, and use it to affect the content the component generates.
public int getResponseStatus()
The status is valid only if a rule or other code set it.
EbiResponse
public String getURI()
EbiRequest
public boolean hasQueryString()
To get the parameter values, use code like this:
String value = context.getRequest().getParameter(name);
public String getCookieValue(String cookieID)
EbiRequestContext.setCookieValue(String, String, int)
public void setCookieValue(String cookieID, String cookieValue, int maxAge)
When the maximum age of the cookie is a positive value, it indicates that the cookie will expire after that many seconds have passed. Note that the value is the maximum age when the cookie will expire, not the cookie's current age.
A negative value means that the cookie will be deleted when the Web browser exits. A zero value causes the cookie to be deleted.
cookieID
- An identifier for the cookie.cookieValue
- The value for the cookie.maxAge
- The duration in seconds that the cookie will be saved by the browser.public void setRequestResponse(HttpServletRequest req, HttpServletResponse res)
req
- An HTTP servlet request object.res
- An HTTP servlet response object.public void setResponsePhrase(String phrase)
Typically, the response phrase is set by a rule's action to hold data that was selected by the rule. Check the documentation for rules that you use to find out the effects of their actions.
phrase
- A String.EbiRequestContext.getResponsePhrase()
,
EbiRequestContext.setResponseStatus( int status )
,
EbiResponse.setResponseType( int responseType )
public void setResponseStatus(int status)
Typically, a rule sets the response status, and your component calls getResponseStatus() to find out the rule's results.
status
- An integer status code indicating the success or failure
of the request.EbiResponse
,
EbiRequestContext.getResponseStatus()
public void setURI(String uri)
uri
- A URI.EbiRequest
public ServletContext getServletContext()
Gets the servlet context.
public void setServletContext(ServletContext scontext)
scontext
- The servlet context of the current Web application.
|
Novell exteNd Director 5.2 API |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |