Skip to content

Docs: Clarify default prefix/suffix of registry.jsp() #35429

@Dongnyoung

Description

@Dongnyoung

Hello,

The current Spring MVC documentation for View Resolvers shows the following example:

@Override
public void configureViewResolvers(ViewResolverRegistry registry) {
    registry.enableContentNegotiation(new MappingJackson2JsonView());
    registry.jsp();
}

However, the documentation does not explain what defaults are applied by registry.jsp().

Problem

  • Readers may assume they must always configure a prefix and suffix manually.

  • In reality, registry.jsp() registers an InternalResourceViewResolver with sensible defaults.

  • The absence of this detail can cause confusion when JSP views are not found.

Suggested Improvement

Add a short [NOTE] block right after the JSP example clarifying:

  • Default prefix: /WEB-INF/

  • Default suffix: .jsp

  • These defaults are applied automatically, and explicit configuration is only needed if you use a different location or extension.

Benefits

  • Prevents confusion about JSP view resolution.

  • Makes the framework’s default behavior explicit.

  • Helps users quickly diagnose view resolution issues without unnecessary configuration.

I’d appreciate your thoughts on this suggestion!

Metadata

Metadata

Assignees

No one assigned

    Labels

    in: webIssues in web modules (web, webmvc, webflux, websocket)status: supersededAn issue that has been superseded by another

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions