Skip to content
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

Add setStripTrailingSlash to DefaultRequestToViewNameTranslator [SPR-6830] #11496

Closed
spring-projects-issues opened this issue Feb 12, 2010 · 2 comments
Assignees
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

Triqui Galletas opened SPR-6830 and commented

I think it would be nice to be able to remove trailing slash when translating requests to views. In my case I've been forced to subclass DefaultRequestToViewNameTranslator to do it.

see http://forum.springsource.org/showthread.php?t=84648.


Reference URL: http://forum.springsource.org/showthread.php?t=84648

Referenced from: commits 103ac03

@spring-projects-issues
Copy link
Collaborator Author

Juergen Hoeller commented

I've added this for 3.0.1 already now, with stripTrailingSlash=true by default since it fits well with the other default stripping rules.

Juergen

@spring-projects-issues
Copy link
Collaborator Author

Triqui Galletas commented

Good. I thought defaulting to true was the best option, too.

Just one little thing, if you are a perfectionist. Maybe you want to update the comments on the class, since it mentions stripping leading slash and file extension, but not the new one.

Interestingly, the comment on the transformPath method already included stripping trailing slash implicitly:
"Transform the request URI (in the context of the webapp) stripping slashes and extensions, and replacing the separator as required."

@spring-projects-issues spring-projects-issues added type: enhancement A general enhancement in: web Issues in web modules (web, webmvc, webflux, websocket) labels Jan 11, 2019
@spring-projects-issues spring-projects-issues added this to the 3.0.1 milestone Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants