Trait

net.liftweb.http

MVCHelper

Related Doc: package http

Permalink

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]

    Permalink

    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

    Permalink

    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

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

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

    Permalink
    Definition Classes
    AnyRef → Any
  4. object MVCResponse

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

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

    Permalink

    Apply the Rest helper

    Apply the Rest helper

    Definition Classes
    MVCHelper → Function1
  7. def applyOrElse[A1 <: Req, B1 >: () ⇒ Box[LiftResponse]](x: A1, default: (A1) ⇒ B1): B1

    Permalink
    Definition Classes
    PartialFunction
  8. final def asInstanceOf[T0]: T0

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

    Permalink

    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
  10. def clone(): AnyRef

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

    Permalink
    Definition Classes
    Function1
    Annotations
    @unspecialized()
  12. def emptyToResp(eb: EmptyBox): Box[LiftResponse]

    Permalink

    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
  13. final def eq(arg0: AnyRef): Boolean

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

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

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

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

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

    Permalink

    Is the Rest helper defined for a given request

    Is the Rest helper defined for a given request

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

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

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

    Permalink
    Definition Classes
    AnyRef
  22. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  23. final def notifyAll(): Unit

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

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

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

    Permalink

    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
  27. def serve(pf: MVCMatch): Unit

    Permalink

    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

    Permalink
    Definition Classes
    AnyRef
  29. def toString(): String

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

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

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

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

Inherited from AnyRef

Inherited from Any

Ungrouped