*** Breaking change *** issue 265 Providing more flexible behaviour for NotFound (404)

5 views
Skip to first unread message

Marius

unread,
Jan 9, 2010, 4:52:23 PM1/9/10
to Lift
Hi all,

This affects LiftRules.uriNotFound. It was changed from

type URINotFoundPF = PartialFunction[(Req, Box[Failure]),
LiftResponse]

to

type URINotFoundPF = PartialFunction[(Req, Box[Failure]), NotFound]

Where NotFound is a trait having 4 refinements:

// Default behavior where Lift is returning some XhtmlResponse
case object DefaultNotFound extends NotFound

// Use it to directly return a response to client (i.e. redirects etc)
case class NotFoundAsResponse(response: LiftResponse) extends NotFound

// Specify a template that will be rendered if the page is not found.
This will be rendered
// though the normal rendering pipeline
case class NotFoundAsTemplate(path: ParsePath) extends NotFound

// Use an arbitrary NodeSeq as a not found response.
case class NotFoundAsNode(node: NodeSeq) extends NotFound


Br's,
Marius

Timothy Perrett

unread,
Jan 9, 2010, 5:50:42 PM1/9/10
to Lift
Very nice stuff Marius, kudos.

Cheers, Tim

Reply all
Reply to author
Forward
0 new messages