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

optional path elements in routes #185

Closed
musketyr opened this Issue Dec 17, 2012 · 1 comment

Comments

Projects
None yet
1 participant
@musketyr
Contributor

musketyr commented Dec 17, 2012

if you have a lot of optional path elements in you url, the routes file can become pretty messy and hard to maintain

for example in case of having url mapping

/@category/@subcategory/@country/@state/@city/in-@time/page-@page 
    => handler.groovy?category=@category&subcategory=@subcategory&country=@country&state=@state&city=@city&page=@page

where country, state, city, time and page are optional you need following url mappings

/@category/@subcategory/@country/@state/@city/in-@time/page-@page
/@category/@subcategory/@country/@state/in-@time/page-@page
/@category/@subcategory/@country/in-@time/page-@page
/@category/@subcategory/in-@time/page-@page
/@category/@subcategory/@country/@state/@city/page-@page
/@category/@subcategory/@country/@state/page-@page
/@category/@subcategory/@country/page-@page
/@category/@subcategory/page-@page
/@category/@subcategory/@country/@state/@city/in-@time
/@category/@subcategory/@country/@state/in-@time
/@category/@subcategory/@country/in-@time
/@category/@subcategory/in-@time
/@category/@subcategory/@country/@state/@city
/@category/@subcategory/@country/@state
/@category/@subcategory/@country
/@category/@subcategory

would be nice if I could it define only once e.g. using following notation

/@category/@subcategory/@country?/@state?/@city?/in-@time?/page-@page?

it also implies that those path variables will be translated to query string like page=@page.

@musketyr

This comment has been minimized.

Show comment
Hide comment
@musketyr

musketyr Dec 17, 2012

Contributor

fixed in a641ca0

Contributor

musketyr commented Dec 17, 2012

fixed in a641ca0

@musketyr musketyr closed this Dec 17, 2012

musketyr added a commit that referenced this issue Dec 21, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment