Oracle Fusion Middleware Disc API Reference for Oracle WebLogic Portal
10g Release 3 (10.3.4)
E14257-04

Class XMLHttpRequest


public class XMLHttpRequest

This class implements a "portal-aware" wrapper around native browser XMLHttpRequest implementations. Passing portlet action URLs to instances of this class's open method allows such actions to be invoked by Ajax client code, which can then make use of the markup-fragment- or data-oriented responses that may be generated, in typical Ajax-fashion. The behavior resulting from passing other portal URLs to such instances may result in undefined or undesirable behavior. Non-portal URLs will simply pass-through to the browser's native XMLHttpRequest implementation.

This class is implemented to be as conforming to the XMLHttpRequest specification as possible.

This object also is provided in the bea.netuix.ajax.client namespace for backward compatibility, though that namespace is considered to be deprecated for purposes of accessing of this class.

This class is implemented as a thin layer on top of Disc's XIE module. As such, interactions made via instances of this class may cause any or all of the global XIE events to fire (though XIE's UI-blocking overlay is automatically suppressed for such interactions).

See Also:
bea.wlp.disc.xie.Events

Field Summary
public function onreadystatechange
            A settable callback function, akin to its peer in native XHR implementations.
public number readyState
            The request ready state, akin to its peer in native XHR implementations.
public string responseText
            The response text, akin to its peer in native XHR implementations.
public object responseXML
            The response XML, akin to its peer in native XHR implementations.
public number status
            A response status code, akin to its peer in native XHR implementations.
public string statusText
            The response status text, akin to its peer in native XHR implementations.
 
Method Summary
public void abort()
          Aborts the request, akin to its peer in native XHR implementations.
public string getAllResponseHeaders()
          Returns a string containing all response headers, akin to its peer in native XHR implementations.
public string getResponseHeader(name)
          Returns a response header, by name, akin to its peer in native XHR implementations.
public void open(method, loc, [async], [user], [password])
          Prepares this instance to make a request, akin to its peer in native XHR implementations.
public void send([data])
          Send the prepared request, akin to its peer in native XHR implementations.
public void setRequestHeader(name, value)
          Sets a custom request header, akin to its peer in native XHR implementations.
 
Field Detail

onreadystatechange

public function onreadystatechange
A settable callback function, akin to its peer in native XHR implementations

readyState

public number readyState
The request ready state, akin to its peer in native XHR implementations

responseText

public string responseText
The response text, akin to its peer in native XHR implementations

responseXML

public object responseXML
The response XML, akin to its peer in native XHR implementations

status

public number status
A response status code, akin to its peer in native XHR implementations

statusText

public string statusText
The response status text, akin to its peer in native XHR implementations

Method Detail

abort

public void abort() 
Aborts the request, akin to its peer in native XHR implementations.

getAllResponseHeaders

public string getAllResponseHeaders() 
Returns a string containing all response headers, akin to its peer in native XHR implementations.
Returns:
string - All response headers in string representation, if available

getResponseHeader

public string getResponseHeader(name) 
Returns a response header, by name, akin to its peer in native XHR implementations.
Parameters:
string name - The name of the response header
Returns:
string - The value of the named response header, if available

open

public void open(method, loc, [async], [user], [password]) 
Prepares this instance to make a request, akin to its peer in native XHR implementations.
Parameters:
string method - The method (e.g. 'POST', 'GET', etc) to use when making the request
string loc - The URL to request
boolean [async] - Whether or not the request should be made asynchronously
string [user] - A user name, for HTTP authentication scenarios
string [password] - A password, for HTTP authentication scenarios

send

public void send([data]) 
Send the prepared request, akin to its peer in native XHR implementations.
Parameters:
string [data] - Optional post data to send with the request

setRequestHeader

public void setRequestHeader(name, value) 
Sets a custom request header, akin to its peer in native XHR implementations.
Parameters:
string name - The name of the request header to set
string value - The value of the request header to set


Oracle Fusion Middleware Disc API Reference for Oracle WebLogic Portal
10g Release 3 (10.3.4)
E14257-04

Copyright © 2011, Oracle. All rights reserved.