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

@RequestMapping handled incorrectly when value contains "." (dot) character [SPR-6482] #11148

Closed
spring-projects-issues opened this issue Dec 1, 2009 · 8 comments
Assignees
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: bug A general bug
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Dec 1, 2009

Aleš Najmann opened SPR-6482 and commented

At the moment in my code exist method with such signature:

@RequestMapping(value = "/projects/{filter}/{order}-{direction}", method = RequestMethod.GET)
public String filteredProjectListing(@PathVariable("filter") String filter, @PathVariable("order") String order,
            @PathVariable("direction") String direction, ModelMap model) {
 ...
}

order is String variable containing ognl-like expresssion ie. "raging.result" (which I later use for BeanComparator) but this mapping is in version RC3 is not found, which is different behaviour from RC2 where there is no such problem.

Log message with example of given fault result is:

2009-12-01 16:38:02,459 WARN [org.springframework.web.servlet.PageNotFound] - <No mapping found for HTTP request with URI [/Example/projects/all/rate.result-asc.html] in DispatcherServlet with name 'Example'>

There is no problem with handling path which doesn't contain more '.' (dot) characters, so this can probably help you with analysis of the problem.


Affects: 3.0 RC3

Attachments:

Issue Links:

Referenced from: commits 976f920

1 votes, 3 watchers

@spring-projects-issues
Copy link
Collaborator Author

Grzegorz Borkowski commented

We have the same problem. After switching to RC3, some code stopped working, throwing "no mapping found for HTTP request".

@spring-projects-issues
Copy link
Collaborator Author

Scott Andrews commented

Unit test for UriTemplateServletAnnotationControllerTests.java that demonstrates this issue.

Changing the mapping to include an explicit regex allows the test to path, but is not ideal.

For example:
@RequestMapping("/hotels/{hotel:.*}/bookings")

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Dec 7, 2009

Arjen Poutsma commented

This regression was due to a matching change made as fix for #10947. I've reverted that behavior, so things should work now.

Could you please try a upcoming snapshot and see if it is fixed?

@spring-projects-issues
Copy link
Collaborator Author

Christopher Anderson commented

Excellent, will try tonight's build tomorrow.

@spring-projects-issues
Copy link
Collaborator Author

Christopher Anderson commented

That worked. Thanks

@spring-projects-issues
Copy link
Collaborator Author

Kirk Larsen commented

test

@spring-projects-issues
Copy link
Collaborator Author

Christanto commented

The issue still happens in 3.0.5.
"abc.xyz" will be returned as "abc".

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Jul 9, 2011

Christanto commented

Sorry I think you can close this as this issue is actually reported in #10832.

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: bug A general bug
Projects
None yet
Development

No branches or pull requests

2 participants