Hi all,

  I have a silly question about the url rewrite in the lift.
  It has another two params in the url after the img.

  http://localhost:8080/show/img/version/id

  The url works fine.
  => http://localhost:8080/show/img
  => http://localhost:8080/show/img/v1/
  => http://localhost:8080/show/img/v1/1

  Get 404 error if the "/" string is not added at the end of the url
(the id param isn't supplied)
  => http://localhost:8080/show/img/v1

  So, how can i rewrite the url and set the sitemap can make this link
(  http://localhost:8080/show/img/v1  )
  works fine as (  http://localhost:8080/show/img/v1/  ) when the id
is not supplied.

  Here is the code:

###
  case RewriteRequest(
      ParsePath(List("show", "img", version, id), _, _,_), _, _) =>
    RewriteResponse(List("show", "img"),
      Map("version" -> version, "id" -> id)
  )
###
val entries = Menu(Loc("Home", List("index"), "Home")) ::
Menu(Loc("show", List("show"), "show", Hidden)) :: User.sitemap

###

  BTW, I use the LiftView to handle the request.

###
class show extends LiftView {
  def dispatch = {
    case "img" => imgDispatch _
    case _ => allDispatch _
  }

  def imgDispatch(): Box[NodeSeq] = {
    ...
  }

  def allDispatch(): Box[NodeSeq] = {
    ...
  }
}
###

  Thanks very much!

Cheers,
  Neil

-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to lift...@googlegroups.com.
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.

Reply via email to