Skip to content

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

Closed
@spring-projects-issues

Description

@spring-projects-issues

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions