Skip to content

Revisit RedirectView's use of getCurrentWebApplicationContext() [SPR-13346] #17930

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
spring-projects-issues opened this issue Aug 12, 2015 · 1 comment
Assignees
Labels
type: enhancement A general enhancement
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Aug 12, 2015

Juergen Hoeller opened SPR-13346 and commented

Since 3.1, RedirectView falls back to a ContextLoader.getCurrentWebApplicationContext() check to determine the ServletContext for building a RequestContext, which in turn gets used to retrieve the current RequestDataValueProcessor (if any). This doesn't seem to be the best possible arrangement, since the ServletContext is just used to retrieve the root WebApplicationContext... when we actually started with a current WebApplicationContext to begin with! Also, there is HttpServletRequest.getServletContext() since Servlet 3.0... even if there is probably no benefit in using that one here, it's generally preferable to a WebApplicationContext.getServletContext() lookup.


Affects: 4.2 GA

Issue Links:

Referenced from: commits 4314da9

@spring-projects-issues
Copy link
Collaborator Author

Juergen Hoeller commented

Revised through the introduction of RequestContextUtils.findWebApplicationContext.

Juergen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants