Skip to content

Update default for favorPathExtension to match Javadoc and as intended for 5.3 #26119

@mwftapi

Description

@mwftapi

Affected Version: Spring Web 5.3.1.

Deprecation note on ContentNegotiationManagerFactoryBean:setFavorPathExtension(boolean) is misleading.

/**
* Whether the path extension in the URL path should be used to determine
* the requested media type.
* <p>By default this is set to {@code false} in which case path extensions
* have no impact on content negotiation.
* @deprecated as of 5.2.4. See class-level note on the deprecation of path
* extension config options. As there is no replacement for this method,
* in 5.2.x it is necessary to set it to {@code false}. In 5.3 the default
* changes to {@code false} and use of this property becomes unnecessary.
*/
@Deprecated
public void setFavorPathExtension(boolean favorPathExtension) {
this.favorPathExtension = favorPathExtension;
}

It states that As there is no replacement for this method, in 5.2.x it is necessary to set it to {@code false}. In 5.3 the default changes to {@code false} and use of this property becomes unnecessary.

But the default value of favorPathExtension still is true.

If the property is not used, path extension will be favored indicating that a call to setFavorPathExtension(false) is still necessary, contrary to the deprecation note.

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)type: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions