se.kmr.scam.client.http.util
Class Context

java.lang.Object
  extended byse.kmr.scam.client.http.util.Context

public class Context
extends Object

Provides access to the different context available in the HTTP interface.

Version:
$Revision: 1.8 $
Author:
Jöran
Created:
den 21 augusti 2002

Field Summary
static String APPLICATION
          Identifier for application scope
static String REQUEST
          Identifer for request scope
static String SESSION
          Identifier for session scope
 
Constructor Summary
Context()
           
 
Method Summary
static Object getAttribute(String name, HttpServletRequest request)
          Gets a named attribute from context scope.
static Object getAttribute(String name, HttpServletRequest request, String scope)
          Gets a named attribute from in a defined context scope.
static Collection listAttributes(String name, HttpServletRequest request)
          List a named attribute.
static Collection listAttributes(String name, HttpServletRequest request, String scope)
          List a named attribute in a defined context scope.
static void setAttribute(String name, Object attribute, HttpServletRequest request, String scope)
          Binds an object to name in designated context.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

REQUEST

public static final String REQUEST
Identifer for request scope

See Also:
Constant Field Values

SESSION

public static final String SESSION
Identifier for session scope

See Also:
Constant Field Values

APPLICATION

public static final String APPLICATION
Identifier for application scope

See Also:
Constant Field Values
Constructor Detail

Context

public Context()
Method Detail

getAttribute

public static Object getAttribute(String name,
                                  HttpServletRequest request)
Gets a named attribute from context scope. Request scope is searched first, then session scope and last application scope.

Parameters:
name - Name of attribute
request - Request object
Returns:
The attribute value if the name is bound in any context, otherwise null. Note: NEVER a Collection

listAttributes

public static Collection listAttributes(String name,
                                        HttpServletRequest request)
List a named attribute.

Parameters:
name - Name of attribute
request - Request object
Returns:
Collection of values (never null)
See Also:
getAttribute(String, HttpServletRequest)

getAttribute

public static Object getAttribute(String name,
                                  HttpServletRequest request,
                                  String scope)
Gets a named attribute from in a defined context scope.

Parameters:
name - Name of attribute
request - Requset object
scope - Find attribute in this context scope
Returns:
The attribute value if the name is bound in context scope, otherwise null. Note: NEVER a Collection

listAttributes

public static Collection listAttributes(String name,
                                        HttpServletRequest request,
                                        String scope)
List a named attribute in a defined context scope.

Parameters:
name - Name of attribute
request - Request object
Returns:
Collection of values (never null)
See Also:
getAttribute(String, HttpServletRequest, String)

setAttribute

public static void setAttribute(String name,
                                Object attribute,
                                HttpServletRequest request,
                                String scope)
Binds an object to name in designated context.

Parameters:
name - Bind the object to this name.
attribute - Object to bind.
request - Bind object using this request object.
scope - Defines in wich context the object is bound


Copyright © 2003 SCAM. All Rights Reserved.