net.liftweb.http

MVCHelper

trait MVCHelper extends DispatchPF

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. MVCHelper
  2. PartialFunction
  3. Function1
  4. AnyRef
  5. Any
  1. Hide All
  2. Show all
Learn more about member selection
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

  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. def applyOrElse[A1 <: Req, B1 >: () ⇒ Box[LiftResponse]](x: A1, default: (A1) ⇒ B1): B1

    Definition Classes
    PartialFunction
  10. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  11. 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
  12. def clone(): AnyRef

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

    Definition Classes
    Function1
    Annotations
    @unspecialized()
  14. 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
  15. final def eq(arg0: AnyRef): Boolean

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

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

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

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

    Definition Classes
    AnyRef → Any
  20. 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
  21. final def isInstanceOf[T0]: Boolean

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

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

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

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

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

    Definition Classes
    PartialFunction
  27. def runWith[U](action: (() ⇒ Box[LiftResponse]) ⇒ U): (Req) ⇒ Boolean

    Definition Classes
    PartialFunction
  28. 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
  29. 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
  30. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  31. def toString(): String

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  34. 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

Ungrouped