How to generate complex url like stackoverflow?

Posted by Freewind on Stack Overflow See other posts from Stack Overflow or by Freewind
Published on 2011-01-15T08:13:53Z Indexed on 2011/01/15 9:53 UTC
Read the original article Hit count: 372

Filed under:
|

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.

© Stack Overflow or respective owner

Related posts about url

Related posts about playframework