ServiceRequest Class

Used to represent an HTTP request

Constructors

public ServiceRequest( HttpServletRequest request )
public ServiceRequest( String service, HttpServletRequest request )

Methods

authenticate( ) returns void
getCredentials( ) returns String[]
getFields( ) returns javaxt.express.ServiceRequest.Field[]
Returns an array of fields
getFilter( ) returns javaxt.express.ServiceRequest.Filter
getID( ) returns Long
Returns the ID associated with the request. Assuming the service request follows the convention "http://localhost/servlet/service/object", the ID for the "http://localhost/photos/config/user/54" is 54. If an ID is not found in the path or is invalid, then the id parameter in the query string is returned. Example: "http://localhost/photos/config/user?id=54"
getJson( ) returns JSONObject
getLimit( ) returns Long
getMethod( ) returns String
Returns the method name from the http request. Service requests may include object/entity name in the path using the following convention: "http://localhost/servlet/service/object". For example "http://localhost/photos/config/user". In this example, the service name is "config" and the object/entity name is "user". If the http request method is "GET" then the method name is "getUser". If the http request method is "DELETE" then the method name is "deleteUser". If the http request method is "PUT" or "POST" then the method name is "saveUser".
getOffset( ) returns Long
getParameter( String key ) returns javaxt.utils.Value
Returns the value of a specific variable supplied in the query string. If the value is "null" then a null value is returned.
keyQuery string parameter name. Performs a case insensitive search for the keyword.
getParameterNames( ) returns String[]
getPath( ) returns String
Returns a part of the url path AFTER the service name. For example, "http://localhost/servlet/service/a/b/c" would yield "/a/b/c".
getPath( int i ) returns javaxt.utils.Value
Returns a part of the url path at a given index AFTER the service name. For example, index 0 for "http://localhost/servlet/service/a/b/c" would yield "a".
getPayload( ) returns byte[]
getRequest( ) returns HttpServletRequest
getService( ) returns String
Returns the service name from the http request. Service requests follow the convention: "http://localhost/servlet/service/path". For example "http://localhost/photos/config/user". In this example, the servlet path is "photos" and the service name is "config". Note that the servlet path is optional and may include multiple "directories". This method makes it easier to find the service name from the url.
getSort( ) returns javaxt.express.ServiceRequest.Sort
Used to parse the orderby parameters found the url query string.
getURL( ) returns javaxt.utils.URL
Returns the original url used to make the request.
getUser( ) returns java.security.Principal
Returns the user associated with the request
getWhere( ) returns String
hasParameter( String key ) returns boolean
setParameter( String key, String val ) returns void
setPath( String path ) returns void
Used to set the url path
pathURL path, excluding servlet and service path