class LiftRules extends Factory with FormVendor with LazyLoggable
LiftRules is the global object that holds all of Lift's configuration.
- Alphabetic
- By Inheritance
- LiftRules
- LazyLoggable
- FormVendor
- Factory
- SimpleInjector
- Injector
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new LiftRules()
Type Members
- abstract class FactoryMaker[T] extends StackableMaker[T] with Vendor[T]
Create an object or val that is a subclass of the FactoryMaker to generate factory for a particular class as well as define session and request specific vendors and use doWith to define the vendor just for the scope of the call.
Create an object or val that is a subclass of the FactoryMaker to generate factory for a particular class as well as define session and request specific vendors and use doWith to define the vendor just for the scope of the call.
- Definition Classes
- Factory
- trait FirstBox[F, T] extends AnyRef
- abstract class Inject[T] extends StackableMaker[T] with Vendor[T]
- Definition Classes
- SimpleInjector
- class RulesSeq[T] extends AnyRef
Generic container used mainly for adding functions
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def addSyncProvider(asyncMeta: AsyncProviderMeta): Unit
Register an AsyncMeta provider in addition to the default Jetty6, Jetty7, and Servlet 3.0 providers
- def addToPackages(what: Package): Unit
Tells Lift where to find Snippets, Views, Comet Actors and Lift ORM Model object
- def addToPackages(what: String): Unit
Tells Lift where to find Snippets,Views, Comet Actors and Lift ORM Model object
- val afterSend: RulesSeq[(BasicResponse, HTTPResponse, List[(String, String)], Box[Req]) => Any]
Holds user functions that are executed after the response is sent to client.
Holds user functions that are executed after the response is sent to client. The functions' result will be ignored.
- var ajaxDefaultFailure: Box[() => JsCmd]
The default action to take when the JavaScript action fails
- var ajaxEnd: Box[() => JsCmd]
The JavaScript to execute at the end of an Ajax request (for example, removing the spinning working thingy)
- var ajaxPostTimeout: Int
- var ajaxRetryCount: Box[Int]
How many times do we retry an Ajax command before calling it a failure?
- var ajaxScriptUpdateTime: (LiftSession) => Long
Holds the last update time of the Ajax request.
Holds the last update time of the Ajax request. Based on this server may return HTTP 304 status indicating the client to used the cached information.
- var ajaxStart: Box[() => JsCmd]
The JavaScript to execute at the beginning of an Ajax request (for example, showing the spinning working thingy)
- val allAround: RulesSeq[LoanWrapper]
Add functionality around all of the HTTP request/response cycle.
Add functionality around all of the HTTP request/response cycle. This is an optimal place to get a database connection. Note that whatever is loaned at the beginning of the request will not be returned until the end of the request. It's super-important to (1) not do anything related to state or touch the request objects or anything else at the beginning or end of the loan wrapper phase; (2) make sure that your code does not throw exceptions as exceptions can cause major problems.
- val allowAttributeSnippets: FactoryMaker[() => Boolean]
This FactoryMaker can be used to disable the little used attributeSnippets
- val allowParallelSnippets: FactoryMaker[Boolean]
Does the current context support parallel snippet execution
- def appendGlobalFormBuilder[T](builder: FormBuilderLocator[T]): Unit
- Definition Classes
- FormVendor
- def appendRequestFormBuilder[T](builder: FormBuilderLocator[T]): Unit
- Definition Classes
- FormVendor
- def appendSessionFormBuilder[T](builder: FormBuilderLocator[T]): Unit
- Definition Classes
- FormVendor
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- var assetRootPath: String
The root path for the assets folder.
The root path for the assets folder.
This applies also to the URL domain, appended after the deployed context path. In app developer's work area this folder resides under the 'webapp' folder.
For example to store asset files under 'myassets' folder, use value '/myassets/'. Assets under this configurable path follow conventions, for example the default lazy loading spinner ('ajax-loader.gif') is under 'images' folder.
Thus the URL to the assets folder would be: 'http://<domain name>/<context path>/myassets/'
- lazy val asyncProviderMeta: Box[AsyncProviderMeta]
The meta for the detected AsyncProvider given the container we're running in
- var attachResourceId: (String) => String
Attaches an ID entity for resource URI specified in link or script tags.
Attaches an ID entity for resource URI specified in link or script tags. This allows controlling browser resource caching. By default this just adds a query string parameter unique per application lifetime. More complex implementation could user per resource MD5 sequences thus "forcing" browsers to refresh the resource only when the resource file changes. Users can define other rules as well. Inside user's function it is safe to use S context as attachResourceId is called from inside the <lift:with-resource-id> snippet
- var attributeForRemovedEventAttributes: Option[String]
The attribute used to expose the names of event attributes that were removed from a given element for separate processing in JS (when
extractInlineJavaScriptistrue).The attribute used to expose the names of event attributes that were removed from a given element for separate processing in JS (when
extractInlineJavaScriptistrue). By default, Lift removes event attributes and attaches those behaviors via a separate JS file, to avoid inline JS invocations so that a restrictive content security policy can be used.You can set this variable so that the resulting HTML will have attribute information about the removed attributes, in case you need them for e.g. CSS selector matching. The attribute will contain a space-separated list of JS attributes that were removed by Lift's processing.
For example, if you needed to match elements with an
onclickattribute in CSS, you would usually do:[onclick] { text-decoration: underline; }And have an element:
<span onclick="jsCode()">Do something!</span>In Lift 3, this would not work, as the onclick attribute would be removed before HTML serialization, so your HTML would be:
<span id="lift-event-js-F827001738725NKMEQNF">Do something!</span>Instead, you could set:
LiftRules.attributeForRemovedEventAttributes = Some("data-lift-removed-attributes")
The HTML Lift emitted would then look like:
<span id="lift-event-js-F827001738725NKMEQNF" data-lift-removed-attributes="onclick">Do something!</span>
This makes it possible to replace the old CSS with with similar matching for the
data-lift-removed-attributesattribute:[data-lift-removed-attributes~=onclick] { text-decoration: underline; } - var authentication: HttpAuthentication
The HTTP authentication mechanism that Lift will perform.
The HTTP authentication mechanism that Lift will perform. See LiftRules.protectedResource
- val autoIncludeAjaxCalc: FactoryMaker[() => (LiftSession) => Boolean]
- var autoIncludeComet: (LiftSession) => Boolean
Tells Lift if the Comet JavaScript should be included.
Tells Lift if the Comet JavaScript should be included. By default it is set to true.
- val beforeSend: RulesSeq[(BasicResponse, HTTPResponse, List[(String, String)], Box[Req]) => Any]
Holds user functions that are executed before sending the response to client.
Holds user functions that are executed before sending the response to client. The functions' result will be ignored.
- def buildPackage(end: String): List[String]
Used by Lift to construct full package names from the packages provided to addToPackages function
- var calcIE6ForResponse: () => Boolean
- var calcIEMode: () => Boolean
The function that calculates if the response should be rendered in IE6/7/8 compatibility mode
- var calcRequestTimeout: Box[(Req) => Int]
Put a function that will calculate the request timeout based on the incoming request.
- var calculateContextPath: () => Box[String]
If there is an alternative way of calculating the context path (by default returning Empty)
If there is an alternative way of calculating the context path (by default returning Empty)
If this function returns an Empty, the contextPath provided by the container will be used.
- var calculateXmlHeader: (NodeResponse, Node, Box[String]) => String
An XML header is inserted at the very beginning of returned XHTML pages.
An XML header is inserted at the very beginning of returned XHTML pages. This function defines the cases in which such a header is inserted. The function takes a NodeResponse (the LiftResponse that is converting the XML to a stream of bytes), the Node (root node of the XML), and a Box containing the content type.
- val clientActorLifespan: FactoryMaker[(LiftActor) => Long]
Server-side actors that represent client-side actor endpoints (client actors, Round Trips) need a lifespan.
Server-side actors that represent client-side actor endpoints (client actors, Round Trips) need a lifespan. By default, it's 60 seconds, but you might want to make it longer if the client is going to get delayed by long computations that bar it from re-establishing the long polling connection
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- val cometCreation: RulesSeq[CometCreationPF]
Partial function to allow you to build a CometActor from code rather than via reflection
- val cometCreationFactory: FactoryMaker[(CometCreationInfo) => Box[LiftCometActor]]
A factory that will vend comet creators
- var cometFailureRetryTimeout: Long
If a Comet request fails timeout for this period of time.
If a Comet request fails timeout for this period of time. Default value is 10 seconds
- var cometGetTimeout: Int
- def cometLogger: Logger
Holds the CometLogger that will be used to log comet activity
- var cometLoggerStringSecurer: (String) => String
Sometimes the comet logger (which is really the Ajax logger) needs to have the string cleaned up to remove stuff like passwords.
Sometimes the comet logger (which is really the Ajax logger) needs to have the string cleaned up to remove stuff like passwords. That's done by this function.
- def cometLogger_=(newLogger: Logger): Unit
Holds the CometLogger that will be used to log comet activity
- var cometProcessingTimeout: Long
The timeout in milliseconds of a comet ajax-request.
The timeout in milliseconds of a comet ajax-request. Defaults to 5000 ms.
- var cometRenderTimeout: Long
The timeout in milliseconds of a comet render-request.
The timeout in milliseconds of a comet render-request. Defaults to 30000 ms.
- var cometRequestTimeout: Box[Int]
If you want the AJAX request timeout to be something other than 120 seconds, put the value here
- var cometServer: () => Option[String]
Calculate the Comet Server (by default, the server that the request was made on, but can do the multi-server thing as well)
- val cometUpdateExceptionHandler: FactoryMaker[Box[JsCmd]]
If this is Full, comet updates (partialUpdates or reRenders) are wrapped in a try/catch statement.
If this is Full, comet updates (partialUpdates or reRenders) are wrapped in a try/catch statement. The provided JsCmd is the body of the catch statement. Within that JsCmd, the variable "e" refers to the caught exception.
In development mode, this defaults to Full and the command within invokes lift.cometOnError with the exception; lift.cometOnError rethrows the exception by default. In production mode, this defaults to Empty.
Note that if you set this to Full, it is highly advised that you rethrow the exception. If you fail to rethrow the exception, you run the risk of dropping an unpredictable number of updates (i.e., if the third of 20 updates that are sent to the client in a single response throws an exception, none of the subsequent ones will run; failing to rethrow the exception means any updates that did not run will never be run).
- def configureLogging: () => Unit
Holds the function that configures logging.
Holds the function that configures logging. Must be set before any loggers are created
- def configureLogging_=(newConfigurer: () => Unit): Unit
Holds the function that configures logging.
Holds the function that configures logging. Must be set before any loggers are created
- var contentParsers: List[ContentParser]
Handles the parsing of template content into NodeSeqs.
Handles the parsing of template content into NodeSeqs. If multiple parsers are registered for the same template suffix, the first matching parser is used. This intended to be set in in
Bootas it is read only once during the processing of the first template. - var contentSecurityPolicyViolationReport: (ContentSecurityPolicyViolation) => Box[LiftResponse]
Handles content security policy violation reports reported to the default reporting endpoint (see
ContentSecurityPolicy.defaultReportUri).Handles content security policy violation reports reported to the default reporting endpoint (see
ContentSecurityPolicy.defaultReportUri).If an
Emptyis returned from this function, a default 200 response will be returned. The default implementation simply logs the violation at WARN level. - def context: HTTPContext
Returns the HTTPContext
- var convertResponse: PartialFunction[(Any, List[(String, String)], List[HTTPCookie], Req), LiftResponse]
convertResponse is a PartialFunction that reduces a given Tuple4 into a LiftResponse that can then be sent to the browser.
- val convertToEntity: FactoryMaker[Boolean]
Should codes that represent entities be converted to XML entities when rendered?
- val dataAttributeProcessor: RulesSeq[DataAttributeProcessor]
Ever wanted to add custom attribute processing to Lift? Here's your chance.
Ever wanted to add custom attribute processing to Lift? Here's your chance. Every attribute with the data- prefix will be tested against this RulesSeq and if there's a match, then use the rule process. Simple, easy, cool.
- val dateTimeConverter: FactoryMaker[DateTimeConverter]
- def defaultGetResource(name: String): Box[URL]
Obtain the resource URL by name
- var defaultHeaders: PartialFunction[(NodeSeq, Req), List[(String, String)]]
- def defaultLocaleCalculator(request: Box[HTTPRequest]): Locale
- def defaultTimeZoneCalculator(request: Box[HTTPRequest]): TimeZone
- val deferredSnippetFailure: FactoryMaker[(Failure) => NodeSeq]
If a deferred snippet has a failure during render, what should we display?
- val deferredSnippetTimeout: FactoryMaker[NodeSeq]
If a deferred snippet has a failure during render, what should we display?
- var determineContentType: PartialFunction[(Box[Req], Box[String]), String]
A partial function that determines content type based on an incoming Req and Accept header
- var devModeFailureResponseCodeOverride: Box[Int]
In Dev mode and Test mode, return a non-200 response code if there is an error on the page (one that would result in the red box with the error message being displayed).
In Dev mode and Test mode, return a non-200 response code if there is an error on the page (one that would result in the red box with the error message being displayed). This helps in testing automation.
- val dispatch: RulesSeq[DispatchPF]
Holds the user's DispatchPF functions that will be executed in stateful context
- var displayHelpfulSiteMapMessages_?: Boolean
Set to false if you want to have 404's handled the same way in dev and production mode
- def doWith[F, T](builder: FormBuilderLocator[T])(f: => F): F
- Definition Classes
- FormVendor
- def doWithResource[T](name: String)(f: (InputStream) => T): Box[T]
Open a resource by name and process its contents using the supplied function.
- def doneBoot: Boolean
Does the LiftRules instance think it's done booting?
- val early: RulesSeq[(HTTPRequest) => Any]
Holds user functions that will be executed very early in the request processing.
Holds user functions that will be executed very early in the request processing. The functions' result will be ignored.
- val earlyInStateful: RulesSeq[(Box[Req]) => Unit]
Execute certain functions early in a Stateful Request This is called early in a stateful request (one that's not serviced by a stateless REST request and one that's not marked as a stateless HTML page request).
Execute certain functions early in a Stateful Request This is called early in a stateful request (one that's not serviced by a stateless REST request and one that's not marked as a stateless HTML page request).
DPP strongly recommends that everything that you do related to user state is done with
earlyInStateful, instead of usingonBeginServicing. - val earlyInStateless: RulesSeq[(Box[Req]) => Unit]
Execute certain functions early in a Stateful Request
- val earlyResponse: RulesSeq[(Req) => Box[LiftResponse]] with FirstBox[Req, LiftResponse]
- def enableCometRehydration(): Unit
Adjusts LiftRules to allow a page's comets to "rehydrate" (i.e.
Adjusts LiftRules to allow a page's comets to "rehydrate" (i.e. reconnect to the page) after a server restart. This works by reloading the page into an iframe and stealing all of the comets. When the refresh occurs, new comet actors will be instantiated, so beware that any state therein will NOT be reinstated. Applications utilizing this feature should be designed to reconstruct comet state from the DB, cookies, client info, etc as required.
- var enableContainerSessions: Boolean
- var enableLiftGC: Boolean
By default lift uses a garbage-collection mechanism of removing unused bound functions from LiftSesssion.
By default lift uses a garbage-collection mechanism of removing unused bound functions from LiftSesssion. Setting this to false will disable this mechanisms and there will be no Ajax polling requests attempted.
- var encodeJSessionIdInUrl_?: Boolean
Should the JSESSIONID be encoded in the URL if cookies are not supported
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- val exceptionHandler: RulesSeq[ExceptionHandlerPF]
The sequence of partial functions (pattern matching) for handling converting an exception to something to be sent to the browser depending on the current RunMode (development, etc.)
The sequence of partial functions (pattern matching) for handling converting an exception to something to be sent to the browser depending on the current RunMode (development, etc.)
By default it returns an XhtmlResponse containing a predefined markup. You can overwrite this by calling LiftRules.exceptionHandler.prepend(...). If you are calling append then your code will not be called since a default implementation is already appended.
- val excludePathFromContextPathRewriting: FactoryMaker[(String) => Boolean]
Update the function here that calculates particular paths to excluded from context path rewriting
- var explicitlyParsedSuffixes: Set[String]
When a request is parsed into a Req object, certain suffixes are explicitly split from the last part of the request URI.
When a request is parsed into a Req object, certain suffixes are explicitly split from the last part of the request URI. If the suffix is contained in this list, it is explicitly split. The default list is: "html", "htm", "jpg", "png", "gif", "xml", "rss", "json" ...
- val externalTemplateResolver: FactoryMaker[() => PartialFunction[(Locale, List[String]), Box[NodeSeq]]]
There may be times when you want to entirely control the templating process.
There may be times when you want to entirely control the templating process. You can insert a function to this factory that will do your custom template resolution. If the PartialFunction isDefinedAt the given locale/path, then that's the template returned. In this way, you can return Empty for a template that's not found and the template will not be found. Otherwise, if the function is not defined for the locale/path pair, the normal templating system will be used. Also, keep in mind how FactoryMaker can be used... it can be global, per request, etc.
- var extractInlineJavaScript: Boolean
Enables or disables event attribute and script element extraction.
Enables or disables event attribute and script element extraction.
Lift can extract script elements and event attributes like onclick, onchange, etc, and attach the event handlers in a separate JavaScript file that is generated per-page. This allows for populating these types of JavaScript in your snippets via CSS selector transforms, without needing to allow inline scripts in your content security policy (see
securityRules).However, there are certain scenarios where event attribute extraction cannot provide a 1-to-1 reproduction of the behavior you'd get with inline attributes or scripts; if your application hits these scenarios and you would prefer not to adjust them to work with a restrictive content security policy, you can allow inline scripts and set
extractEventAttributesto false to disable event extraction. - def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- def fixCSS(path: List[String], prefix: Box[String]): Unit
Modifies the root relative paths from the css url-s
Modifies the root relative paths from the css url-s
- path
the path of the css resource
- prefix
the prefix to be added on the root relative paths. If this is Empty, the prefix will be the application context path.
- var flipDocTypeForIE6: Boolean
- val formAttrs: FactoryMaker[List[String]]
If you use the form attribute in a snippet invocation, what attributes should be copied from the snippet invocation tag to the form tag.
If you use the form attribute in a snippet invocation, what attributes should be copied from the snippet invocation tag to the form tag. The default list is "class", "id", "target", "style", "onsubmit"
- var funcNameGenerator: () => String
Provides a function that returns random names for form variables, page ids, callbacks, etc.
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- var getLiftSession: (Req) => LiftSession
- var getResource: (String) => Box[URL]
Obtain the resource URL by name
- val guardedSettingViolationFunc: LiftRulesGuardedSetting[(SettingViolation) => Unit]
- var handleMimeFile: (String, String, String, InputStream) => FileParamHolder
The function that converts a fieldName, contentType, fileName and an InputStream into a FileParamHolder.
The function that converts a fieldName, contentType, fileName and an InputStream into a FileParamHolder. By default, create an in-memory instance. Use OnDiskFileParamHolder to create an on-disk version
- val handleUnmappedParameter: FactoryMaker[(Req, String) => Unit]
When a parameter is received either via POST or GET and does not have a corresponding mapping on the server, the function provided by this FactoryMaker will be called with the req and parameter name.
When a parameter is received either via POST or GET and does not have a corresponding mapping on the server, the function provided by this FactoryMaker will be called with the req and parameter name.
By default, if the parameter looks Lift-like (i.e., it starts with an F), then we log a warning with the given parameter name and URI.
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- val htmlProperties: FactoryMaker[(Req) => HtmlProperties]
A unified set of properties for managing how to treat HTML, XHTML, HTML5.
A unified set of properties for managing how to treat HTML, XHTML, HTML5. The default behavior is to return an Html5Properties instance, but you can change this.
LiftRules.htmlProperties.default.set((r: Req) => new XHtmlInHtml5OutProperties(r.userAgent))
- val httpAuthProtectedResource: RulesSeq[HttpAuthProtectedResourcePF]
Defines the resources that are protected by authentication and authorization.
Defines the resources that are protected by authentication and authorization. If this function is not defined for the input data, the resource is considered unprotected ergo no authentication is performed. If this function is defined and returns a Full box, it means that this resource is protected by authentication, and authenticated subjed must be assigned to the role returned by this function or to a role that is child-of this role. If this function returns Empty it means that this resource is protected by authentication but no authorization is performed meaning that roles are not verified.
- implicit def inject[T](implicit man: Manifest[T]): Box[T]
- Definition Classes
- SimpleInjector → Injector
- def installServiceRequestTimer(default: ServiceRequestTimer): Unit
- def installSnippetTimer(default: SnippetTimer): Unit
Enable snippet timing and install a default snippet timer.
Enable snippet timing and install a default snippet timer. This method can only be invoked during boot.
This method only enables snippet timing and sets the default snippet timer. If you want to change snipping timing behavior for specific sessions or requests, you'll want to interact with the underlying
FactoryMakerafter its set up. - final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- val javaScriptSettings: FactoryMaker[() => Box[(LiftSession) => JsObj]]
Tells Lift which JavaScript settings to use.
Tells Lift which JavaScript settings to use. If Empty, does not include the JS settings.
- var jsArtifacts: JSArtifacts
Holds the JS library specific UI artifacts.
Holds the JS library specific UI artifacts. By default it uses JQuery's artifacts
Please note that currently any setting other than
JQueryArtifactswill switch you to using Lift's liftVanilla implementation, which is meant to work independent of any framework. This implementation is experimental in Lift 3.0, so use it at your own risk and make sure you test your application! - var jsLogFunc: Box[(JsVar) => JsCmd]
The JavaScript to execute to log a message on the client side when lift.logError is called.
The JavaScript to execute to log a message on the client side when lift.logError is called.
If Empty no logging is performed The default when running in DevMode is to call lift.logError which will use JavaScript console if available or alert otherwise.
To always use alert set:
LiftRules.jsLogFunc = Full(v => JE.Call("alert",v).cmd)
- val jsonOutputConverter: FactoryMaker[(JValue) => String]
The function that converts a JValue to a String.
The function that converts a JValue to a String.
By default, use prettyRender for dev mode and compactRender for other modes.
- val lazySnippetTimeout: FactoryMaker[util.Helpers.TimeSpan]
How long should we wait for all the lazy snippets to render
- lazy val liftBuildDate: Date
- var liftContextRelativePath: String
Contains the URI path under which all built-in Lift-handled requests are scoped.
Contains the URI path under which all built-in Lift-handled requests are scoped. It does not include the context path and should not begin with a /.
- var liftCoreResourceName: String
The base name of the resource bundle of the lift core code
- var liftGCFailureRetryTimeout: Long
The polling interval for background Ajax requests to keep functions to not be garbage collected.
The polling interval for background Ajax requests to keep functions to not be garbage collected. This will be applied if the Ajax request will fail. Default value is set to 15 seconds.
- var liftGCPollingInterval: Long
The polling interval for background Ajax requests to prevent functions of being garbage collected.
The polling interval for background Ajax requests to prevent functions of being garbage collected. Default value is set to 75 seconds.
- def liftPath: String
Returns a complete URI, including the context path, under which all built-in Lift-handled requests are scoped.
- val liftRequest: RulesSeq[LiftRequestPF]
Get the partial function that defines if a request should be handled by the application (rather than the default container handler)
- val liftTagProcessing: RulesSeq[LiftTagPF]
Allows user adding additional Lift tags (the tags must be prefixed by lift namespace such as <lift:xxxx/>).
Allows user adding additional Lift tags (the tags must be prefixed by lift namespace such as <lift:xxxx/>). Each LiftTagPF function will be called with the following parameters:
- Element label, - The Element itselft, - The attributes - The child nodes - The page name
- lazy val liftVersion: String
- def loadResource(name: String): Box[Array[Byte]]
Obtain the resource as an array of bytes by name
- def loadResourceAsString(name: String): Box[String]
Obtain the resource as a String by name
- def loadResourceAsXml(name: String): Box[NodeSeq]
Obtain the resource as an XML by name.
Obtain the resource as an XML by name. If you're using this to load a template, consider using the Template object instead.
- See also
Template
- var localeCalculator: (Box[HTTPRequest]) => Locale
A function that takes the current HTTP request and returns the current
- var localizationLookupFailureNotice: Box[(String, Locale) => Unit]
The function referenced here is called if there's a localization lookup failure
- var localizeStringToXml: (String) => NodeSeq
A function that defines how a String should be converted to XML for the localization stuff.
A function that defines how a String should be converted to XML for the localization stuff. By default, Text(s) is returned, but you can change this to attempt to parse the XML in the String and return the NodeSeq.
- var logServiceRequestTiming: Boolean
Controls whether or not the service handling timing messages (Service request (GET) ...
Controls whether or not the service handling timing messages (Service request (GET) ... took ... Milliseconds) are logged. If set to false NoOpServiceTimer is used. We should remove this setting in Lift-4 and only depend on serviceRequestTimer Defaults to true.
- var logUnreadRequestVars: Boolean
This variable controls whether RequestVars that have been set but not subsequently read will be logged in Dev mode.
This variable controls whether RequestVars that have been set but not subsequently read will be logged in Dev mode. Logging can be disabled at the per-RequestVar level via RequestVar.logUnreadVal
- See also
RequestVar#logUnreadVal
- var loggedInTest: Box[() => Boolean]
Put a test for being logged in into this function
- lazy val logger: Logger
- Attributes
- protected
- Definition Classes
- LazyLoggable
- Annotations
- @transient()
- var makeCometBreakoutDecision: (LiftSession, Req) => Unit
A function that takes appropriate action in breaking out of any existing comet requests based on the request, browser type, etc.
- val maxConcurrentRequests: FactoryMaker[(Req) => Int]
The maximum concurrent requests.
The maximum concurrent requests. If this number of requests are being serviced for a given session, messages will be sent to all Comet requests to terminate
- var maxMimeFileSize: Long
The maximum allowed size of a single file in a mime multi-part POST.
The maximum allowed size of a single file in a mime multi-part POST. Default 7MB
- var maxMimeSize: Long
The maximum allowed size of a complete mime multi-part POST.
The maximum allowed size of a complete mime multi-part POST. Default 8MB
- def mimeHeaders: Box[Map[String, List[String]]]
Returns any mimeHeaders for the currently invoked handleMimeFile.
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- val noAjaxSessionCmd: FactoryMaker[JsCmd]
The JsCmd to execute when the ajax session is lost.
The JsCmd to execute when the ajax session is lost. The ajax session is considered lost when either an ajax request comes in for a session that does not exist on the server.
By default, we invoke lift.ajaxOnSessionLost, which can be overridden client-side for more complex work. lift.ajaxOnSessionLost reloads the page by default.
- val noCometSessionCmd: FactoryMaker[JsCmd]
The JsCmd to execute when the comet session is lost.
The JsCmd to execute when the comet session is lost. The comet session is considered lost when either (a) a comet request comes in for a session that does not exist on the server or (b) a comet request comes in for a session that has no associated comet actors (this typically happens when the server restarts).
By default, we invoke lift.cometOnSessionLost, which can be overridden client-side for more complex work. lift.cometOnSessionLost reloads the current page by default.
- val noticesAutoFadeOut: FactoryMaker[(Value) => Box[(util.Helpers.TimeSpan, util.Helpers.TimeSpan)]]
Set the default fadeout mechanism for Lift notices.
Set the default fadeout mechanism for Lift notices. Thus you provide a function that take a NoticeType.Value and decide the duration after which the fade out will start and the actual fadeout time. This is applicable for general notices (not associated with id-s) regardless if they are set for the page rendering, ajax response or Comet response.
- def noticesContainerId: String
- val noticesEffects: FactoryMaker[(Box[Value], String) => Box[JsCmd]]
Use this to apply various effects to the notices.
Use this to apply various effects to the notices. The user function receives the NoticeType and the id of the element containing the specific notice. Thus it is the function's responsibility to form the javascript code for the visual effects. This is applicable for both ajax and non ajax contexts. For notices associated with ID's the user type will receive an Empty notice type. That's because the effect is applied on the real estate holding the notices for this ID. Typically this contains a single message.
- var noticesToJsCmd: () => JsCmd
This function is called to convert the current set of Notices into a JsCmd that will be executed on the client to display the Notices.
This function is called to convert the current set of Notices into a JsCmd that will be executed on the client to display the Notices.
- See also
net.liftweb.builtin.snippet.Msgs
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- val onBeginServicing: RulesSeq[(Req) => Unit]
Holds user function hooks when the request is about to be processed It's legacy from when Lift was a lot more Rails-like.
Holds user function hooks when the request is about to be processed It's legacy from when Lift was a lot more Rails-like. It's called literally at the very beginning of the servicing of the HTTP request. The S scope is not available nor is the DB connection available in onBeginServicing. We recommend using earlyInStateful.
- val onEndServicing: RulesSeq[(Req, Box[LiftResponse]) => Unit]
Holds user function hooks when the request was processed
- val overwrittenReponseHeaders: FactoryMaker[List[String]]
By default, Http response headers are appended.
By default, Http response headers are appended. However, there are some headers that should only appear once (for example "expires"). This Vendor vends the list of header responses that can only appear once.
- var passNotFoundToChain: Boolean
Should pages that are not found be passed along the request processing chain to the next handler outside Lift?
- def performTransform(in: LiftResponse): LiftResponse
Runs responseTransformers
- val preAccessControlResponse_!!: RulesSeq[(Req) => Box[LiftResponse]] with FirstBox[Req, LiftResponse]
- def prependGlobalFormBuilder[T](builder: FormBuilderLocator[T]): Unit
- Definition Classes
- FormVendor
- def prependRequestFormBuilder[T](builder: FormBuilderLocator[T]): Unit
- Definition Classes
- FormVendor
- def prependSessionFormBuilder[T](builder: FormBuilderLocator[T]): Unit
- Definition Classes
- FormVendor
- var progressListener: (Long, Long, Int) => Unit
The global multipart progress listener: pBytesRead - The total number of bytes, which have been read so far.
The global multipart progress listener: pBytesRead - The total number of bytes, which have been read so far. pContentLength - The total number of bytes, which are being read. May be -1, if this number is unknown. pItems - The number of the field, which is currently being read. (0 = no item so far, 1 = first item is being read, ...)
- var redirectAsyncOnSessionLoss: Boolean
Set to false if you do not want ajax/comet requests that are not associated with a session to call their respective session loss handlers (set via LiftRules.noAjaxSessionCmd and LiftRules.noCometSessionCmd).
- def registerInjection[T](f: () => T)(implicit man: Manifest[T]): Unit
- Definition Classes
- SimpleInjector
- var requestTimedOut: Box[(Req, Any) => Box[LiftResponse]]
If the request times out (or returns a non-Response) you can intercept the response here and create your own response
- val resourceBundleFactories: RulesSeq[ResourceBundleFactoryPF]
- val resourceForCurrentLoc: FactoryMaker[() => List[ResourceBundle]]
Given the current location (based on the Req.path.partPath), what are the resource bundles in the templates for the current page.
Given the current location (based on the Req.path.partPath), what are the resource bundles in the templates for the current page.
- See also
DefaultRoutines.resourceForCurrentLoc()
- var resourceNames: List[String]
The base name of the resource bundle
- var resourceServerPath: String
The path to handle served resources
- val responseTransformers: RulesSeq[(LiftResponse) => LiftResponse]
Holds the user's transformer functions allowing the user to modify a LiftResponse before sending it to client.
- def searchSnippetsWithRequestPath(name: String): List[String]
Implementation for snippetNamesToSearch that looks first in a package named by taking the current template path.
Implementation for snippetNamesToSearch that looks first in a package named by taking the current template path. For example, suppose the following is configured in Boot: LiftRules.snippetNamesToSearch.default.set(() => LiftRules.searchSnippetsWithRequestPath) LiftRules.addToPackages("com.mycompany.myapp") LiftRules.addToPackages("com.mycompany.mylib") The tag <lift:MySnippet> in template foo/bar/baz.html would search for the snippet in the following locations:
- com.mycompany.myapp.snippet.foo.bar.MySnippet
- com.mycompany.myapp.snippet.MySnippet
- com.mycompany.mylib.snippet.foo.bar.MySnippet
- com.mycompany.mylib.snippet.MySnippet
- and then the Lift builtin snippet packages
- var securityRules: () => SecurityRules
The security rules used by Lift to secure this application.
The security rules used by Lift to secure this application. These mostly relate to HTTPS handling and HTTP
Content-Security-Policy. See theSecurityRulesdocumentation for more.Once the application has started using these, they are locked in, so make sure to set them early in the boot process.
- val serviceRequestTimer: LiftRulesGuardedSetting[FactoryMaker[ServiceRequestTimer]]
Handles logging of servicing a request two default implementations:
Handles logging of servicing a request two default implementations:
- NoOpServiceTimer that does nothing
- StandardServiceTimer that logs time it takes to serve the request (Service request (GET) ... took ... Milliseconds). This is the default used.
Set custom in Boot: LiftRules.installServiceRequestTimer(MyCustomServiceTimer)
- var servletSessionIdentifier: String
A session identifier for net.liftweb.http.provider.servlet.HTTPServletSession.
A session identifier for net.liftweb.http.provider.servlet.HTTPServletSession.
Under most circumstances, you won't need to change this value. However, in some cases containers will be configured with backing datastores that don't play nice with the default value. In those cases you can change this string to get those working.
- var sessionCreator: (HTTPSession, String) => LiftSession
A function that takes the HTTPSession and the contextPath as parameters and returns a LiftSession reference.
A function that takes the HTTPSession and the contextPath as parameters and returns a LiftSession reference. This can be used in cases subclassing LiftSession is necessary.
- def sessionCreatorForMigratorySessions: (HTTPSession, String) => LiftSession
A method that returns a function to create migratory sessions.
A method that returns a function to create migratory sessions. If you want migratory sessions for your application,
LiftRules.sessionCreator = LiftRules.sessionCreatorForMigratorySessions - val sessionInactivityTimeout: FactoryMaker[Box[Long]]
If you want to make the Lift inactivity timeout shorter than the container inactivity timeout, set the inactivity timeout here
- def setAjaxEnd(f: Func0[JsCmd]): Unit
Set the Ajax end JavaScript function.
Set the Ajax end JavaScript function. The Java-callable alternative to assigning the var ajaxEnd
- def setAjaxStart(f: Func0[JsCmd]): Unit
Set the Ajax end JavaScript function.
Set the Ajax end JavaScript function. The Java-callable alternative to assigning the var ajaxStart
- def setContext(in: HTTPContext): Unit
Sets the HTTPContext
- def setSiteMap(sm: SiteMap): Unit
Define the sitemap.
- def setSiteMapFunc(smf: () => SiteMap): Unit
Set the sitemap to a function that will be run to generate the sitemap.
Set the sitemap to a function that will be run to generate the sitemap.
This allows for changing the SiteMap when in development mode and having the function re-run for each request.
This is **NOT** a mechanism for dynamic SiteMap. This is a mechanism **ONLY** for allowing you to change the SiteMap during development. There will be significant performance penalties (serializing the service of requests... only one at a time) for changing the SiteMap.
- def siteMap: Box[SiteMap]
Return the sitemap if set in Boot.
Return the sitemap if set in Boot. If the current runMode is development mode, the sitemap may be recomputed on each page load.
- var siteMapFailRedirectLocation: List[String]
The default location to send people if SiteMap access control fails.
The default location to send people if SiteMap access control fails. The path is expressed a a List[String]
- val snippetDispatch: RulesSeq[SnippetDispatchPF]
The dispatcher that takes a Snippet and converts it to a DispatchSnippet instance
- val snippetFailedFunc: RulesSeq[(SnippetFailure) => Unit]
Set a snippet failure handler here.
Set a snippet failure handler here. The class and method for the snippet are passed in
- var snippetNamesToSearch: FactoryMaker[(String) => List[String]]
Function that generates variants on snippet names to search for, given the name from the template.
Function that generates variants on snippet names to search for, given the name from the template. The default implementation just returns name :: Nil (e.g. no change). The names are searched in order. See also searchSnippetsWithRequestPath for an implementation.
- val snippetTimer: LiftRulesGuardedSetting[Option[FactoryMaker[SnippetTimer]]]
Snippet timers are used to time and record the execution time of snippets.
Snippet timers are used to time and record the execution time of snippets. We provide two default implementations for you:
- NoOpSnippetTimer that does nothing
- LoggingSnippetTimer that logs snippet times.
To enable snippet timing, invoke
LiftRules.installSnippetTimer. Once enabled you can use the snippet timer like a regularFactoryMaker. If you only want snippet timing for certain sessions or requests, invokeinstallSnippetTimerwith theNoOpSnippetTimerand change the value for the sessions or requests where you want snippet timing.Since this is a
FactoryMakeryou can programmatically override it for an individual request or session as you see fit. You can also implement your own timer! - val snippetWhiteList: FactoryMaker[() => PartialFunction[(String, String), Box[(NodeSeq) => NodeSeq]]]
There may be times when you want to entirely control the templating process.
There may be times when you want to entirely control the templating process. You can insert a function that creates a white list of snippets. The white list is the exhaustive list of snippets. The snippets are class/method pairs. If the partial function is defined and the result is a Full Box, the function is run. If the Box is an EmptyBox, then the result is a snippet lookup failure. If the partial function is not defined, then the normal snippet resolution mechanism is used. Please note that in Scala a Map is PartialFunction and you can create Maps that have a default value using the withDefaultValue method.
- val snippets: RulesSeq[SnippetPF]
Holds the user's snippet functions that will be executed by lift given a certain path.
- val statefulRewrite: RulesSeq[RewritePF]
Holds the user's rewrite functions that can alter the URI parts and query parameters.
Holds the user's rewrite functions that can alter the URI parts and query parameters. This rewrite takes place within the scope of the S state so SessionVars and other session-related information is available.
Note also that rewrites should not have side effects except to memoize database query results. No side effects means that you should not change SessionVars in a rewrite.
In general, rewrites should be considered low level access. Rather than using a rewrite to extract parameters out of a URL, you'll be much better off using SiteMap generally and Menu.param and Menu.params specifically for extracting parameters from URLs. - val statelessDispatch: RulesSeq[DispatchPF]
Holds user's DispatchPF functions that will be executed in a stateless context.
Holds user's DispatchPF functions that will be executed in a stateless context. This means that no session will be created and no JSESSIONID cookie will be presented to the user (unless the user has presented a JSESSIONID cookie).
This is the way to do stateless REST in Lift
- val statelessReqTest: RulesSeq[StatelessReqTestPF]
Certain paths and requests within your application can be marked as stateless and if there is access to Lift's stateful facilities (setting SessionVars, updating function tables, etc.) the developer will receive a notice and the operation will not complete.
- val statelessRewrite: RulesSeq[RewritePF]
Holds the user's rewrite functions that can alter the URI parts and query parameters.
Holds the user's rewrite functions that can alter the URI parts and query parameters. This rewrite is performed very early in the HTTP request cycle and may not include any state. This rewrite is meant to rewrite requests for statelessDispatch.
Note also that rewrites should not have side effects except to memoize database query results. No side effects means that you should not change SessionVars in a rewrite. - val statelessSession: FactoryMaker[(Req) => LiftSession with StatelessSession]
- var stdRequestTimeout: Box[Int]
If you want the standard (non-AJAX) request timeout to be something other than 10 seconds, put the value here
- val stripComments: FactoryMaker[Boolean]
Should comments be stripped from the served XHTML
- val suffixSplitters: RulesSeq[SplitSuffixPF]
Determines the path parts and suffix from given path parts
- val supplementalHeaders: FactoryMaker[List[(String, String)]]
Compute the headers to be sent to the browser in addition to anything else that's sent.
Compute the headers to be sent to the browser in addition to anything else that's sent.
Note that the headers for the applications
SecurityRulesare also set here, so if you override the supplemental headers, you should either refer back to the default set or make sure to includeLiftRules.securityRules.headers. - final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- val tagProcessor: RulesSeq[TagProcessor]
Ever wanted to match on *any* arbitrary tag in your HTML and process it any way you wanted? Well, here's your chance, dude.
Ever wanted to match on *any* arbitrary tag in your HTML and process it any way you wanted? Well, here's your chance, dude. You can capture any tag and do anything you want with it.
Note that this set of PartialFunctions is run for **EVERY** node in the DOM so make sure it runs *FAST*.
Also, no subsequent processing of the returned NodeSeq is done (no LiftSession.processSurroundAndInclude()) so evaluate everything you want to.
But do avoid infinite loops, so make sure the PartialFunction actually returns true *only* when you're going to return a modified node.
An example might be:
case ("script", e, session) if e.getAttribute("data-serverscript").isDefined => ...
- var templateCache: Box[TemplateCache[(Locale, List[String]), NodeSeq]]
- lazy val theServletAsyncProvider: Box[(HTTPRequest) => ServletAsyncProvider]
A function that converts the current Request into an AsyncProvider.
- var throwOnOutOfScopeVarAccess: Boolean
Should an exception be thrown on out of scope Session and RequestVar access.
Should an exception be thrown on out of scope Session and RequestVar access. By default, no.
- var timeZoneCalculator: (Box[HTTPRequest]) => TimeZone
A function that takes the current HTTP request and returns the current
- def toString(): String
- Definition Classes
- AnyRef → Any
- val unloadHooks: RulesSeq[() => Unit]
Hooks to be run when LiftServlet.destroy is called.
- var unusedFunctionsLifeTime: Long
If Lift garbage collection is enabled, functions that are not seen in the page for this period of time (given in milliseconds) will be discarded, hence eligible for garbage collection.
If Lift garbage collection is enabled, functions that are not seen in the page for this period of time (given in milliseconds) will be discarded, hence eligible for garbage collection. The default value is 10 minutes.
- def updateAsyncMetaList(f: (List[AsyncProviderMeta]) => List[AsyncProviderMeta]): Unit
- val uriNotFound: RulesSeq[URINotFoundPF]
The list of partial function for defining the behavior of what happens when URI is invalid and you're not using a site map
- val urlDecorate: RulesSeq[URLDecoratorPF]
Use this PartialFunction to to automatically add static URL parameters to any URL reference from the markup of Ajax request.
- var useXhtmlMimeType: Boolean
If you don't want lift to send the application/xhtml+xml mime type to those browsers that understand it, then set this to { @code false }
- def vendForm[T](implicit man: Manifest[T]): Box[(T, (T) => Any) => NodeSeq]
Given a type manifest, vend a form
Given a type manifest, vend a form
- Definition Classes
- FormVendor
- val viewDispatch: RulesSeq[ViewDispatchPF]
Change this variable to set view dispatching
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- var xhtmlValidator: Box[XHtmlValidator]
Define the XHTML validator
- object RulesSeq