net.liftweb.http.RequestVar

class RequestVar

abstract class RequestVar[T](dflt : => T)

 extends AnyVar[T, RequestVar[T]] with HasLogUnreadVal


A typesafe container for data with a lifetime nominally equivalent to the lifetime of a page rendered by an HTTP request. RequestVars maintain their value throughout the duration of the current HTTP request and any callbacks for servicing AJAX calls associated with the rendered page. RequestVar instances have no value at the beginning of request servicing (excluding AJAX callbacks) and their value is discarded at the end of request processing. They are commonly used to share values across many snippets. Basic usage: object MySnippetCompanion { object myRequestVar extends RequestVar[String]("hello") } The standard pattern is to create a singleton object extending RequestVar instead of creating an instance variable of a concrete RequestVar subclass. This is preferred because RequestVar will use the name of its instantiating class for part of its state maintenance mechanism. If you find it necessary to create a RequestVar subclass of which there may be more than one instance, it is necessary to override the __nameSalt() method to return a unique salt value for each instance to prevent name collisions.
param
dflt - - the default value to be returned if none was set prior to requesting a value to be returned from the container


Source: Vars.scala(148)

Direct Known Subclasses

userRoles, PageName, WithParamVar,

 Constructors

def this(dflt : => T)

 Fields

__nameSalt.. protected def __nameSalt String AnyVarTrait
calcDefaultValue.. protected def calcDefaultValue T AnyVar
get.. def get T AnyVarTrait
is.. def is T AnyVarTrait
logUnreadVal.. def logUnreadVal
This defines whether or not Lift will log when a RequestVar is set but then not read within the same request cycle [details]
Change this to false to turn off logging. Logging can also be turned off globally via LiftRules.logUnreadRequestVars.
see
- LiftRules#logUnreadRequestVars
Boolean
name.. protected lazy val name String AnyVarTrait
set_?.. def set_? Boolean AnyVarTrait

 Methods

!=.. final def !=(arg0 : Any) Boolean Any
!=.. final def !=(arg0 : Object) Boolean AnyRef
==.. final def ==(arg0 : Object) Boolean AnyRef
==.. final def ==(arg0 : Any) Boolean Any
apply.. def apply(arg0 : T) T AnyVarTrait
asInstanceOf.. final def asInstanceOf[T0] T0 Any
clearFunc.. protected override def clearFunc(name : String) Unit
clone.. protected def clone Object AnyRef
doSync.. def doSync[F](f : => F)
Different Vars require different mechanisms for synchronization [details]
This method implements the Var specific synchronization mechanism
F
doWith.. def doWith[F](arg0 : T) F AnyVarTrait
eq.. final def eq(arg0 : Object) Boolean AnyRef
equals.. def equals(arg0 : Any) Boolean AnyRef
finalize.. protected def finalize Unit AnyRef
findFunc.. protected override def findFunc(name : String) Box[T]
generateSnapshotRestorer.. final def generateSnapshotRestorer[T]
Generate a function that will take a snapshot of the current RequestVars such that they can be restored
(() => T) => T
getClass.. final def getClass Class[Any] AnyRef
hashCode.. def hashCode Int AnyRef
isInstanceOf.. final def isInstanceOf[T0] Boolean Any
ne.. final def ne(arg0 : Object) Boolean AnyRef
notify.. final def notify Unit AnyRef
notifyAll.. final def notifyAll Unit AnyRef
onShutdown.. protected def onShutdown(arg0 : CleanUpParam) Unit AnyVarTrait
registerCleanupFunc.. protected override def registerCleanupFunc(in : (Box[LiftSession]) => Unit) Unit
registerGlobalCleanupFunc.. protected final def registerGlobalCleanupFunc(arg0 : (CleanUpParam) => Unit) Unit AnyVarTrait
remove.. def remove Unit AnyVarTrait
set.. def set(arg0 : T) T AnyVarTrait
setFunc.. protected override def setFunc(name : String, value : T) Unit
setIsUnset.. def setIsUnset(arg0 : => T) T AnyVarTrait
synchronized.. final def synchronized[T0](arg0 : T0) T0 AnyRef
testWasSet.. protected override def testWasSet(name : String) Boolean
toString.. override def toString String AnyVarTrait
update.. def update(arg0 : (T) => T) T AnyVarTrait
wait.. final def wait(arg0 : Long) Unit AnyRef
wait.. final def wait Unit AnyRef
wait.. final def wait(arg0 : Long, arg1 : Int) Unit AnyRef
wasInitialized.. protected override def wasInitialized(name : String) Boolean
Copyright (c) 2006-2010 WorldWide Conferencing, LLC. All Rights Reserved.