jodd-servlet/src/main/java/jodd/servlet/ServletUtil.java
public static void setScopeAttribute(final String name, final Object value, final String scope, final PageContext pageContext) {
		HttpServletRequest request = (HttpServletRequest) pageContext.getRequest();
		String scopeValue = scope != null ? scope.toLowerCase() : SCOPE_PAGE;
		if (scopeValue.equals(SCOPE_PAGE)) {
			pageContext.setAttribute(name, value);
		}
		else if (scopeValue.equals(SCOPE_REQUEST)) {
			request.setAttribute(name, value);
		}
		else if (scopeValue.equals(SCOPE_SESSION)) {
			request.getSession().setAttribute(name, value);
		}
		else if (scopeValue.equals(SCOPE_APPLICATION)) {
            request.getServletContext().setAttribute(name, value);
        }
		else {
			throw new IllegalArgumentException("Invalid scope: " + scope);
        }
	}
public static void setScopeAttribute(final String name, final Object value, final String scope, final PageContext pageContext) {
		HttpServletRequest request = (HttpServletRequest) pageContext.getRequest();
		String scopeValue = scope != null ? scope.toLowerCase() : SCOPE_PAGE;
		if (scopeValue.equals(SCOPE_PAGE)) {
			pageContext.setAttribute(name, value);
		}
		else if (scopeValue.equals(SCOPE_REQUEST)) {
			request.setAttribute(name, value);
		}
		else if (scopeValue.equals(SCOPE_SESSION)) {
			request.getSession().setAttribute(name, value);
		}
		else if (scopeValue.equals(SCOPE_APPLICATION)) {
            request.getServletContext().setAttribute(name, value);
        }
		else {
			throw new IllegalArgumentException("Invalid scope: " + scope);
        }
	}
public static void setScopeAttribute ( final String name , final Object value , final String scope , final PageContext pageContext ) { HttpServletRequest request = ( HttpServletRequest ) pageContext . getRequest ( ) ; String scopeValue = scope != null ? scope . toLowerCase ( ) : SCOPE_PAGE ; if ( scopeValue . equals ( SCOPE_PAGE ) ) { pageContext . setAttribute ( name , value ) ; } else if ( scopeValue . equals ( SCOPE_REQUEST ) ) { request . setAttribute ( name , value ) ; } else if ( scopeValue . equals ( SCOPE_SESSION ) ) { request . getSession ( ) . setAttribute ( name , value ) ; } else if ( scopeValue . equals ( SCOPE_APPLICATION ) ) { request . getServletContext ( ) . setAttribute ( name , value ) ; } else { throw new IllegalArgumentException ( "Invalid scope: " + scope ) ; } }
Sets scope attribute.
Sets scope attribute .