Review Board 1.5.4

Issue 580 - LiftRules.snippetDispatch should handle StatefulSnippet instances properly

Updated 1 year, 5 months ago

Derek Chen-Becker Reviewers
580 dchenbecker, dpp, marius, charles, joni, atsuhiko, jorge, naftoli, kris, indrajit, alexb, dlouwers, mstarzyk, rmellgren, jhoffman, probinett, jmadsen, mhartmann, jstrachan, jgoday
None LiftWeb-archive
Before this patch, returning a "new some.package.StatefulSnippetClass" from LiftRules.snippetDispatch would end up creating a new instance every time because snippetDispatch was consulted before LiftSession checked to see if there was already an instance available. With this patch you can now do things like:

LiftRules.snippetDispatch.append {
  case "foo" => new com.foo.MyStatefulSnippet
}

and it will properly register and use the same stateful instance the same as if the instance had been resolved via reflection.
On my local test app
Ship it!
Posted 1 year, 5 months ago (August 24th, 2010, 10:37 a.m.)
Looks good.  You may just become the official Lift snippet dispatch guru. ;-)
Review request changed
Updated 1 year, 5 months ago (August 24th, 2010, 12:53 p.m.)
  • changed from LiftRules.snippetDispatch should handle StatefulSnippet instances properly to Issue 580 - LiftRules.snippetDispatch should handle StatefulSnippet instances properly

Always forgetting to put the issue # in the summary :(