TagUtils.java 文件源码

java
阅读 43 收藏 0 点赞 0 评论 0

项目:lams 作者:
/**
 * Determines the scope for a given input {@code String}.
 * <p>If the {@code String} does not match 'request', 'session',
 * 'page' or 'application', the method will return {@link PageContext#PAGE_SCOPE}.
 * @param scope the {@code String} to inspect
 * @return the scope found, or {@link PageContext#PAGE_SCOPE} if no scope matched
 * @throws IllegalArgumentException if the supplied {@code scope} is {@code null}
 */
public static int getScope(String scope) {
    Assert.notNull(scope, "Scope to search for cannot be null");
    if (scope.equals(SCOPE_REQUEST)) {
        return PageContext.REQUEST_SCOPE;
    }
    else if (scope.equals(SCOPE_SESSION)) {
        return PageContext.SESSION_SCOPE;
    }
    else if (scope.equals(SCOPE_APPLICATION)) {
        return PageContext.APPLICATION_SCOPE;
    }
    else {
        return PageContext.PAGE_SCOPE;
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号