Skip to content

Allow valid file extension paths for content negotiation to be specified [SPR-7632] #12288

@spring-projects-issues

Description

@spring-projects-issues

Dave Syer opened SPR-7632 and commented

Allow valid file extension paths to be specified in DispatcherServlet. My use case is

@RequestMapping(value = "/jobs/{jobName}", method = RequestMethod.GET)

I need .html and .json to be valid extensions (stripped off by the dispatcher), but other . separated jobName values are legal and should be presented as they are (e.g. my.job or my.job.html both resolve to my.job).

The current behaviour is simply to truncate at the first period. Even with a regex pattern {jobName:.*} we truncate the path, so the only way to make it work is to add HttpServletRequest to all controller methods and extract the parameter manually (back to Spring 2.5).


Affects: 3.0.6

This issue is a sub-task of #13057

Issue Links:

Referenced from: commits 4fd7645

0 votes, 6 watchers

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)type: taskA general task

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions