public ServletResponse resolveServletResponse() {

        ServletResponse response = getServletResponse();

        //fall back on existing subject instance if it exists:
        if (response == null) {
            Subject existing = getSubject();
            if (existing instanceof WebSubject) {
                response = ((WebSubject) existing).getServletResponse();
            }
        }

        return response;
    }
Default {@code WebSubjectContext} implementation that provides for additional storage and retrieval of
a {@link ServletRequest} and {@link ServletResponse}.

@since 1.0
web/src/main/java/org/apache/shiro/web/subject/support/DefaultWebSubjectContext.java