private Object findObjectInScope()

in struts2-scope-plugin/src/main/java/org/apache/struts2/interceptor/scope/ScopeInterceptor.java [156:180]


    private Object findObjectInScope(ScopeType scopeType, String propName, ActionContext ctx) {
        Object obj = null;
        if (obj == null && (scopeType == ScopeType.ACTION_CONTEXT ||scopeType == ScopeType.UNSPECIFIED)) {
            obj = ctx.get(propName);
        }
        if (obj == null && (scopeType == ScopeType.REQUEST || scopeType == ScopeType.UNSPECIFIED)) {
            obj = ServletActionContext.getRequest().getAttribute(propName);
        }
        if (obj == null && (scopeType == ScopeType.FLASH || scopeType == ScopeType.UNSPECIFIED)) {
            HttpSession session = ServletActionContext.getRequest().getSession(false);
            if (session != null) {
                Map flash = (Map)session.getAttribute(ScopeType.FLASH.toString());
                if (flash != null) {
                    obj = flash.get(propName);
                }
            }
        }
        if (obj == null && (scopeType == ScopeType.SESSION || scopeType == ScopeType.UNSPECIFIED)) {
            obj = ctx.getSession().get(propName);
        }
        if (obj == null && (scopeType == ScopeType.APPLICATION || scopeType == ScopeType.UNSPECIFIED)) {
            obj = ctx.getApplication().get(propName);
        }
        return obj;
    }