Packages

t

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
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. MVCHelper
  2. PartialFunction
  3. Function1
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
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.

    A trait that holds a response for the MVCHelper. Conversions exist from Unit (just serve the template), CssBindFunc (do the substitution on the template), NodeSeq (run the template), LiftResponse (send the response back), or Box or Option of any of the above.

    Attributes
    protected

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def andThen[C](k: (() ⇒ Box[LiftResponse]) ⇒ C): PartialFunction[Req, C]
    Definition Classes
    PartialFunction → Function1
  5. def apply(in: Req): () ⇒ Box[LiftResponse]

    Apply the Rest helper

    Apply the Rest helper

    Definition Classes
    MVCHelper → Function1
  6. def applyOrElse[A1 <: Req, B1 >: () ⇒ Box[LiftResponse]](x: A1, default: (A1) ⇒ B1): B1
    Definition Classes
    PartialFunction
  7. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  8. 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
  9. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  10. def compose[A](g: (A) ⇒ Req): (A) ⇒ () ⇒ Box[LiftResponse]
    Definition Classes
    Function1
    Annotations
    @unspecialized()
  11. 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
  12. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  13. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  14. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  15. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
  16. def hashCode(): Int
    Definition Classes
    AnyRef → Any
  17. 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
  18. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  19. def lift: (Req) ⇒ Option[() ⇒ Box[LiftResponse]]
    Definition Classes
    PartialFunction
  20. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  21. final def notify(): Unit
    Definition Classes
    AnyRef
  22. final def notifyAll(): Unit
    Definition Classes
    AnyRef
  23. def orElse[A1 <: Req, B1 >: () ⇒ Box[LiftResponse]](that: PartialFunction[A1, B1]): PartialFunction[A1, B1]
    Definition Classes
    PartialFunction
  24. def runWith[U](action: (() ⇒ Box[LiftResponse]) ⇒ U): (Req) ⇒ Boolean
    Definition Classes
    PartialFunction
  25. 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.error and redisplay the current page.

    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
  26. 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
  27. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  28. def toString(): String
    Definition Classes
    Function1 → AnyRef → Any
  29. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  30. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  31. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  32. object MVCResponse

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

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

Inherited from AnyRef

Inherited from Any

Ungrouped