Browse files

* Added comments to LiftRules.onBeginServicing and earlyInStateful

* Fixed a lift-json test that was failing at random.
  • Loading branch information...
1 parent 58c6d68 commit 8bb1982b4d3b9ff5cdc291748fd63fcc9dc638eb @fmpwizard fmpwizard committed Dec 6, 2012
View
2 core/json/src/test/scala/net/liftweb/json/JsonParserSpec.scala
@@ -31,7 +31,7 @@ object JsonParserSpec extends Specification with JValueGen with ScalaCheck {
"Any valid json can be parsed" in {
val parsing = (json: JValue) => { parse(Printer.pretty(render(json))); true }
- check(forAll(genJValue)(parsing))
+ check(forAll(parsing))
}
"Buffer size does not change parsing result" in {
View
8 web/webkit/src/main/scala/net/liftweb/http/LiftRules.scala
@@ -1260,6 +1260,10 @@ class LiftRules() extends Factory with FormVendor with LazyLoggable {
/**
* 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 using onBeginServicing.
*/
val earlyInStateful = RulesSeq[Box[Req] => Unit]
@@ -1486,6 +1490,10 @@ class LiftRules() extends Factory with FormVendor with LazyLoggable {
/**
* 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 onBeginServicing = RulesSeq[Req => Unit]

0 comments on commit 8bb1982

Please sign in to comment.