public static void set(PageContext pc, String name, Object value,
                           int scope) {
        switch (scope) {
            case PageContext.PAGE_SCOPE:
                pc.setAttribute(name + PAGE_SCOPE_SUFFIX, value, scope);
                break;
            case PageContext.REQUEST_SCOPE:
                pc.setAttribute(name + REQUEST_SCOPE_SUFFIX, value, scope);
                break;
            case PageContext.SESSION_SCOPE:
                pc.setAttribute(name + SESSION_SCOPE_SUFFIX, value, scope);
                break;
            case PageContext.APPLICATION_SCOPE:
                pc.setAttribute(name + APPLICATION_SCOPE_SUFFIX, value, scope);
                break;
            default:
                throw new IllegalArgumentException("unknown scope");
        }
    }
public static void set ( PageContext pc , String name , Object value , int scope ) { switch ( scope ) { case PageContext . PAGE_SCOPE : pc . setAttribute ( name + PAGE_SCOPE_SUFFIX , value , scope ) ; break ; case PageContext . REQUEST_SCOPE : pc . setAttribute ( name + REQUEST_SCOPE_SUFFIX , value , scope ) ; break ; case PageContext . SESSION_SCOPE : pc . setAttribute ( name + SESSION_SCOPE_SUFFIX , value , scope ) ; break ; case PageContext . APPLICATION_SCOPE : pc . setAttribute ( name + APPLICATION_SCOPE_SUFFIX , value , scope ) ; break ; default : throw new IllegalArgumentException ( "unknown scope" ) ; } }
Sets the value of a configuration variable in the given scope.
<p> Setting the value of a configuration variable is performed as if
each scope had its own namespace, that is, the same configuration
variable name in one scope does not replace one stored in a different
scope.

@param pc    Page context in which the configuration variable is to be set
@param name  Configuration variable name
@param value Configuration variable value
@param scope Scope in which the configuration variable is to be set