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 type-level params not taken into account consistently [SPR-5421] #10095

Closed
spring-projects-issues opened this issue Jan 20, 2009 · 1 comment
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

Ken Sipe opened SPR-5421 and commented

Given the following code:
@Controller
@RequestMapping(param="ex")
public class BookController {

@RequestMapping
public void index() {  }

@RequestMapping(param="id")
public void show() {  }

}

one would expect that in order to invoke either request mapping that an "ex" parameter woud need to be present in the request. so /book/index?ex=a or /book/show?id=1&ex=a . however testing this out, the param requires are as expected for the show method... however a simple /book/index works without a parameter on the index. As I think this through, it is the only default request mapping, however given the restriction on the type shouldn't this request fail with no matching mapping?


Affects: 3.0 M1

@spring-projects-issues
Copy link
Collaborator Author

Juergen Hoeller commented

The primary problem was that for non-singleton controllers, the checking of type-level constraints was accidentally bypassed. It should work consistently now as of 3.0 M2.

Juergen

@spring-projects-issues spring-projects-issues added type: bug A general bug 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 M2 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: bug A general bug
Projects
None yet
Development

No branches or pull requests

2 participants