Freewind
Freewind

Reputation: 198238

How to define a "*" or "ANY" in routes in Play2?

In play1, we can define in routes:

*  /users    Users.index

But the * can't be used in play2. If I write:

*  /users   controllers.Users.index

It will report error:

Compilation error
HTTP Verb expected

How to fix this?

Upvotes: 1

Views: 541

Answers (1)

Pere Villega
Pere Villega

Reputation: 16439

AFAIK it's not supported. To be fair is not something you would like to do anyway.

In HTTP each method (GET, POST) has its own characteristics and usage (idempotence, for example) and having a controller's method behaving differently as per HTTP method used doesn't seem a good idea :)

Upvotes: 1

Related Questions