ali haider
ali haider

Reputation: 20232

case insensitivity for routing in play framework 1.2.5

I am using play framework 1.2.5. If I use camelCase for my controller names, the URL appears to follow the same format. Is there anyway I can keep the camelcase for the controller names without needing to use camelCase in the resulting URL. I believe I could try something like the following (regex in routes.conf) but I was wondering if there is another way:

[aA]dmin

Thanks in advance.

Upvotes: 2

Views: 371

Answers (1)

Tom Carchrae
Tom Carchrae

Reputation: 6476

I did a quick test on one of my projects and the catch all line

# Catch all
*       /{controller}/{action}                  {controller}.{action}

is not case sensitive

So you could simply just use

# Catch all
*       /{action}                  MyController.{action}

If you wanted to expose the admin method as /Admin /admin or even /AdMiN

Upvotes: 1

Related Questions