Cool, thank you very much!
On Sep 8, 8:56 pm, Xavi Ramirez <xavi....@gmail.com> wrote:
> That's because the url "post/show" is being intercepted by the same
> rewrite rule that matches "post/<id>" urls. To get around this, try
> adding an if statement to your rewrite rule:
>
> LiftRules.rewrite.append {
> case RewriteRequest(ParsePath(List("post", id), _, _, _), _, _)
> if (id != "show") =>
> RewriteResponse(List("post","show"), Map("id"->urlDecode(id)))
>
> Hope this helps!
>
> ~Xavi
>
> On Tue, Sep 8, 2009 at 12:12 AM, night_stalker<usur...@gmail.com> wrote:
>
> > I want to make RESTful urls (not REST API), for example:
>
> > "/post/123" is mapped to "post/show.html" with param "id=123"
>
> > but the following rewrite rule seems recursive
>
> > LiftRules.rewrite.append {
> > case RewriteRequest(ParsePath(List("post", id), _, _, _), _, _)
> > =>
> > RewriteResponse(List("post","show"), Map("id"->urlDecode(id)))
> > }
>
> > and loops forever ...
Can't find
RewriteResponse.apply(List[String], Map[String, String], Boolean)
in 1.0 API, is it a new feature?
On Sep 8, 11:52 pm, David Pollak <feeder.of.the.be...@gmail.com>
wrote:
> or:
> LiftRules.rewrite.append {
> case RewriteRequest(ParsePath(List("post", id), _, _, _), _, _)
> =>
> RewriteResponse(List("post","show"), Map("id"->urlDecode(id)), *true*
> )
> }
>
> The true parameter stops the rewriting process so you don't get the infinite
> loop.