net.liftweb.http

MVCHelper

trait MVCHelper extends PartialFunction[Req, () ⇒ Box[LiftResponse]]

Mix this trait into a class to provide support for MVC style coding. Each controller line is defined as:

serve {
  case "user" :: User(user) :: _ => "#name" #> user.firstName
}

The above code matches /user/4, loads the user with primary key 4 from the database, then applies the transform to the /user.html template replacing the node with the id "name" with the firstName of the user

Linear Supertypes
PartialFunction[Req, () ⇒ Box[LiftResponse]], (Req) ⇒ () ⇒ Box[LiftResponse], AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Hide All
  2. Show all
  1. MVCHelper
  2. PartialFunction
  3. Function1
  4. AnyRef
  5. Any
Visibility
  1. Public
  2. All

Type Members

  1. type MVCMatch = PartialFunction[List[String], MVCResponse]

    The partial function to match a request to a response

    The partial function to match a request to a response

    Attributes
    protected
  2. sealed trait MVCResponse extends AnyRef

    A trait that holds a response for the MVCHelper.

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. object MVCResponse extends AnyRef

  7. def andThen[C](k: (() ⇒ Box[LiftResponse]) ⇒ C): PartialFunction[Req, C]

    Definition Classes
    PartialFunction → Function1
  8. def apply(in: Req): () ⇒ Box[LiftResponse]

    Apply the Rest helper

    Apply the Rest helper

    Definition Classes
    MVCHelper → Function1
  9. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  10. implicit def boxToResp[T](in: Box[T])(implicit c: (T) ⇒ MVCResponse): Box[LiftResponse]

    Turn a Box[T] into the return type expected by DispatchPF.

    Turn a Box[T] into the return type expected by DispatchPF. Note that this method will return messages from Failure() and return codes and messages from ParamFailure[Int[(msg, _, _, code)

    Attributes
    protected
  11. def clone(): AnyRef

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  12. def compose[A](g: (A) ⇒ Req): (A) ⇒ () ⇒ Box[LiftResponse]

    Definition Classes
    Function1
  13. def emptyToResp(eb: EmptyBox): Box[LiftResponse]

    Convert an Empty into an appropriate LiftResponse.

    Convert an Empty into an appropriate LiftResponse. In the case of Failure, you may want to display a particular error message to the user.

    Attributes
    protected
  14. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  15. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  16. def finalize(): Unit

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  17. final def getClass(): java.lang.Class[_]

    Definition Classes
    AnyRef → Any
  18. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  19. def isDefinedAt(in: Req): Boolean

    Is the Rest helper defined for a given request

    Is the Rest helper defined for a given request

    Definition Classes
    MVCHelper → PartialFunction
  20. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  21. def lift: (Req) ⇒ Option[() ⇒ Box[LiftResponse]]

    Definition Classes
    PartialFunction
  22. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  23. final def notify(): Unit

    Definition Classes
    AnyRef
  24. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  25. def orElse[A1 <: Req, B1 >: () ⇒ Box[LiftResponse]](that: PartialFunction[A1, B1]): PartialFunction[A1, B1]

    Definition Classes
    PartialFunction
  26. def saveRedir(what: AnyRef { ... /* 2 definitions in type refinement */ }, where: String): () ⇒ Unit

    Validate what, if it passes validation, then redirect to the new URL, else display the messages using S.

    Validate what, if it passes validation, then redirect to the new URL, else display the messages using S.error and redisplay the current page.

    Attributes
    protected
  27. def serve(pf: MVCMatch): Unit

    Serve an MVC page based on matching the path

    Serve an MVC page based on matching the path

    Attributes
    protected
  28. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  29. def toString(): String

    Definition Classes
    Function1 → AnyRef → Any
  30. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()
  31. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()
  32. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()

Inherited from PartialFunction[Req, () ⇒ Box[LiftResponse]]

Inherited from (Req) ⇒ () ⇒ Box[LiftResponse]

Inherited from AnyRef

Inherited from Any