How to generate complex url like stackoverflow?
- by Freewind
I'm using playframework, and I hope to generate complex urls like stackoverflow. For example, I want to generate a question's url:
http://aaa.com/questions/123456/How-to-generator-a-complex-url
Note the last part, it's the title of the question.
But I don't know how to do it.
UPDATED
In the playframework, we can define routes in conf/routes file, and what I do is:
GET /questions/{<\d+>id} Questions.show
In this way, when we call @{Questions.show(id)} in views, it will generate:
http://aaa.com/questions/123456
But how to let the generated has a title part, is difficult.