[Lift] Re: how to serve html fragments

2009-06-04 Thread fatu

Yes it does indeed. Sorry, I was getting confused by the fact that
Firefox still doesn't like the fragment but it happens both when using
a view and when using a template + snippet. The DOCTYPE is indeed
missing in both cases when S.skipDocType is on, I guess what's still
causing trouble is the fact that the XML declaration is still there.

I think I can remember seeing somewhere (group? blogs?) another flag
that, when turned on, would skip the XML declaration but I can't find
it right now. Is there really such a thing or did I only dream about
it?

Thanks.

On 3 Giu, 17:57, David Pollak feeder.of.the.be...@gmail.com wrote:
 On Wed, Jun 3, 2009 at 7:40 AM, fatu fab...@gmail.com wrote:

  ...Another question for now :-)

  Does it work for views as well?

 It should.  Views are treated just like static XHTML files... a source of
 NodeSeq





  Many thanks.

  Fabio

  On 21 Mag, 15:38, David Pollak feeder.of.the.be...@gmail.com wrote:
   On Thu, May 21, 2009 at 12:27 AM, fatu fab...@gmail.com wrote:

Right, didn't think about that alternative.

Thanks and best compliments to you and all the active Lift community
for this superb Scala framework! I really think (and hope) it's going
to have a big impact and a tremendous popularity rise in the next
months, especially with more forthcoming books and articles spreading
the word.

   We ask two things: build cool apps in Lift and be part of this community,
   asking and answering questions.

   Thanks!

On 21 Mag, 06:42, David Pollak feeder.of.the.be...@gmail.com wrote:
 On Wed, May 20, 2009 at 8:38 PM, fatu fab...@gmail.com wrote:

  Hi David,

  yes it will do, thank you so much for such a lightning-fast
  development in reply!

  I'm only thinking about a case that is probably much more of an
  exception than a rule, i.e. when the snippet dynamically decides if
  it
  needs to generate a full page or a fragment (which is not a very
  good
  design anyway IMHO), for example based on some info passed. But
  even
  in that case the snippet will know that and will be able to set
  S.skipDocType = true accordingly, so it should be perfectly fine.
  Plus
  it won't be difficult at all to make the processing diverge in the
  2
  cases by using URL rewrites, redirecting it to a different template
  /
  snippet depending on parameters or URL structure, which is probably
  a
  better design too.

 You could also pass a header flag from your AJAX call.  If the
  header's
set,
 you don't do the boilerplate surround that'll include all the html,
head
 and body tags.

 Anyway, enjoy and thanks for the use case.

 Party on.

  Again many thanks everyone and David especially!

  On May 20, 4:05 pm, David Pollak feeder.of.the.be...@gmail.com
  wrote:
   I'm about to commit S.skipDocType = true | false.  If you set it
  to
true,
   the !DOCTYPE .../ will be omitted from the response page.  This
will
  allow
   your AJAX fragements to pull parts of pages from the server.
   Note
that
   someplace in your snippets, you'll have to set S.skipDocType =
  true.

   Does this address your issue?

   On Wed, May 20, 2009 at 5:13 AM, fatu fab...@gmail.com wrote:

Hi Marius,

as I understand them, Jx classes help in generating JS that can
itself
generate DOM at the client.  Am I wrong? I'd really like to
  serve
back
an HTML fragment built by using the normal Lift template
  pipeline
(so
including surround  bind). Is that possible?

Thanks

On 20 Mag, 13:16, marius d. marius.dan...@gmail.com wrote:
 As I understood you want to make an Ajax request and serve
  back a
 Document Fragment. If so please also take a look at Jx stuff.
  We
 discuss Jx classes in a fairly amount of details in the lift
book.

 Br's,
 Marius

 On May 20, 9:32 am, fatu fab...@gmail.com wrote:

  Timothy,

  thanks for the links, I found them useful and I find your
  blog
in
  general very interesting. Came across scala-blogs.org and
  it
looks
  quite promising as well.

  I knew bind already from the Exploring Lift book which
  I
pull
  from
  git, build with Lyx and keep at hand regularly. In the
  doctype
  post,
  though, I couldn't find a way to specify no doctype
   which I
  think
  is necessary to serve a fragment; plus I couldn't find any
other
  easy
  out-of-the-box way to do it. Shouldn't this use case
  (serving
  fragments), which I think is quite common, be better / more
easily
  supported by the framework? Can someone post an example of
  how
to
  do
  it with raw response handling in the meanwhile?

  Thanks anybody.

  Fabio

  On 26 Apr, 21:49, Timothy 

[Lift] Re: how to serve html fragments

2009-06-04 Thread David Pollak
On Thu, Jun 4, 2009 at 12:10 AM, fatu fab...@gmail.com wrote:


 Yes it does indeed. Sorry, I was getting confused by the fact that
 Firefox still doesn't like the fragment but it happens both when using
 a view and when using a template + snippet. The DOCTYPE is indeed
 missing in both cases when S.skipDocType is on, I guess what's still
 causing trouble is the fact that the XML declaration is still there.

 I think I can remember seeing somewhere (group? blogs?) another flag
 that, when turned on, would skip the XML declaration but I can't find
 it right now. Is there really such a thing or did I only dream about
 it?


Lemme see what I can do.




 Thanks.

 On 3 Giu, 17:57, David Pollak feeder.of.the.be...@gmail.com wrote:
  On Wed, Jun 3, 2009 at 7:40 AM, fatu fab...@gmail.com wrote:
 
   ...Another question for now :-)
 
   Does it work for views as well?
 
  It should.  Views are treated just like static XHTML files... a source of
  NodeSeq
 
 
 
 
 
   Many thanks.
 
   Fabio
 
   On 21 Mag, 15:38, David Pollak feeder.of.the.be...@gmail.com wrote:
On Thu, May 21, 2009 at 12:27 AM, fatu fab...@gmail.com wrote:
 
 Right, didn't think about that alternative.
 
 Thanks and best compliments to you and all the active Lift
 community
 for this superb Scala framework! I really think (and hope) it's
 going
 to have a big impact and a tremendous popularity rise in the next
 months, especially with more forthcoming books and articles
 spreading
 the word.
 
We ask two things: build cool apps in Lift and be part of this
 community,
asking and answering questions.
 
Thanks!
 
 On 21 Mag, 06:42, David Pollak feeder.of.the.be...@gmail.com
 wrote:
  On Wed, May 20, 2009 at 8:38 PM, fatu fab...@gmail.com wrote:
 
   Hi David,
 
   yes it will do, thank you so much for such a lightning-fast
   development in reply!
 
   I'm only thinking about a case that is probably much more of an
   exception than a rule, i.e. when the snippet dynamically
 decides if
   it
   needs to generate a full page or a fragment (which is not a
 very
   good
   design anyway IMHO), for example based on some info passed. But
   even
   in that case the snippet will know that and will be able to set
   S.skipDocType = true accordingly, so it should be perfectly
 fine.
   Plus
   it won't be difficult at all to make the processing diverge in
 the
   2
   cases by using URL rewrites, redirecting it to a different
 template
   /
   snippet depending on parameters or URL structure, which is
 probably
   a
   better design too.
 
  You could also pass a header flag from your AJAX call.  If the
   header's
 set,
  you don't do the boilerplate surround that'll include all the
 html,
 head
  and body tags.
 
  Anyway, enjoy and thanks for the use case.
 
  Party on.
 
   Again many thanks everyone and David especially!
 
   On May 20, 4:05 pm, David Pollak 
 feeder.of.the.be...@gmail.com
   wrote:
I'm about to commit S.skipDocType = true | false.  If you set
 it
   to
 true,
the !DOCTYPE .../ will be omitted from the response page.
  This
 will
   allow
your AJAX fragements to pull parts of pages from the server.
Note
 that
someplace in your snippets, you'll have to set S.skipDocType
 =
   true.
 
Does this address your issue?
 
On Wed, May 20, 2009 at 5:13 AM, fatu fab...@gmail.com
 wrote:
 
 Hi Marius,
 
 as I understand them, Jx classes help in generating JS that
 can
 itself
 generate DOM at the client.  Am I wrong? I'd really like to
   serve
 back
 an HTML fragment built by using the normal Lift template
   pipeline
 (so
 including surround  bind). Is that possible?
 
 Thanks
 
 On 20 Mag, 13:16, marius d. marius.dan...@gmail.com
 wrote:
  As I understood you want to make an Ajax request and
 serve
   back a
  Document Fragment. If so please also take a look at Jx
 stuff.
   We
  discuss Jx classes in a fairly amount of details in the
 lift
 book.
 
  Br's,
  Marius
 
  On May 20, 9:32 am, fatu fab...@gmail.com wrote:
 
   Timothy,
 
   thanks for the links, I found them useful and I find
 your
   blog
 in
   general very interesting. Came across scala-blogs.organd
   it
 looks
   quite promising as well.
 
   I knew bind already from the Exploring Lift book
 which
   I
 pull
   from
   git, build with Lyx and keep at hand regularly. In the
   doctype
   post,
   though, I couldn't find a way to specify no doctype
which I
   think
   is necessary to serve a fragment; plus I couldn't find
 any
 other
   easy
   out-of-the-box way to do it. Shouldn't this use case
   (serving
   fragments), which I think is 

[Lift] Re: Comet request exception

2009-06-04 Thread feelgood

How can I share my sources? By the way, I use 1.1-SNAPSHOT version of
Lift

On 4 июн, 02:15, David Pollak feeder.of.the.be...@gmail.com wrote:
 I just tested against 6.1.18 and it works just fine.

 Can you post the source of your failing app and a link to your version of
 Jetty and I'll track it down?

 Thanks,

 David

 On Wed, Jun 3, 2009 at 12:19 PM, feelgood asseliva...@gmail.com wrote:

  I just copied comet sample named Clock from the p. 142 of the
  liftbook into my app. It doesn't work. First time it renders timestamp
  normally, but since 10 seconds:

  WARN - Request for /comet_request/58946720417/1ha35q9iqp4el failed
  Bail
  java.lang.Exception: Bail
 at net.liftweb.http.LiftRules$.doContinuation(LiftRules.scala:436)
 at net.liftweb.http.LiftServlet.setupContinuation(LiftServlet.scala:
  352)
 at net.liftweb.http.LiftServlet.handleComet(LiftServlet.scala:363)
 at net.liftweb.http.LiftServlet.net$liftweb$http$LiftServlet$
  $dispatchStatefulRequest(LiftServlet.scala:232)
 at net.liftweb.http.LiftServlet$$anonfun$2.apply(LiftServlet.scala:
  155)
 at net.liftweb.http.LiftServlet$$anonfun$2.apply(LiftServlet.scala:
  155)
 at net.liftweb.http.S$.net$liftweb$http$S$$wrapQuery(S.scala:908)
 at
  net.liftweb.http.S$$anonfun$net$liftweb$http$S$$_nest2InnerInit$1$
  $anonfun$apply$18.apply(S.scala:1026)
 at net.liftweb.http.S$.net$liftweb$http$S$$doAround(S.scala:845)
 at net.liftweb.http.S$$anonfun$net$liftweb$http$S$$doAround$1.apply
  (S.scala:846)
 at net.liftweb.mapper.DB$$anon$1.net
  $liftweb$mapper$DB$$anon$$doWith
  (DB.scala:117)
 at
  net.liftweb.mapper.DB$$anon$1$$anonfun$net$liftweb$mapper$DB$$anon$
  $doWith$1.apply(DB.scala:118)
 at
  net.liftweb.mapper.DB$$anon$1$$anonfun$net$liftweb$mapper$DB$$anon$
  $doWith$1.apply(DB.scala:118)
 at net.liftweb.mapper.DB$.use(DB.scala:305)
 at net.liftweb.mapper.DB$$anon$1.net
  $liftweb$mapper$DB$$anon$$doWith
  (DB.scala:118)
 at net.liftweb.mapper.DB$$anon$1.apply(DB.scala:124)
 at net.liftweb.http.S$.net$liftweb$http$S$$doAround(S.scala:846)
 at net.liftweb.http.S$$anonfun$net$liftweb$http$S$$_nest2InnerInit
  $1.apply(S.scala:1024)
 at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:65)
 at net.liftweb.http.S$.net$liftweb$http$S$$_nest2InnerInit(S.scala:
  1023)
 at net.liftweb.http.S$$anonfun$net$liftweb$http$S$$_innerInit$1$
  $anonfun$apply$21$$anonfun$apply$22$$anonfun$apply$23$$anonfun$apply
  $24$$anonfun$apply$25$$anonfun$apply$26.apply(S.scala:1044)
 at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:65)
 at net.liftweb.http.S$$anonfun$net$liftweb$http$S$$_innerInit$1$
  $anonfun$apply$21$$anonfun$apply$22$$anonfun$apply$23$$anonfun$apply
  $24$$anonfun$apply$25.apply(S.scala:1043)
 at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:65)
 at net.liftweb.http.S$$anonfun$net$liftweb$http$S$$_innerInit$1$
  $anonfun$apply$21$$anonfun$apply$22$$anonfun$apply$23$$anonfun$apply
  $24.apply(S.scala:1042)
 at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:65)
 at net.liftweb.http.S$$anonfun$net$liftweb$http$S$$_innerInit$1$
  $anonfun$apply$21$$anonfun$apply$22$$anonfun$apply$23.apply(S.scala:
  1041)
 at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:65)
 at net.liftweb.http.S$$anonfun$net$liftweb$http$S$$_innerInit$1$
  $anonfun$apply$21$$anonfun$apply$22.apply(S.scala:1040)
 at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:65)
 at net.liftweb.http.S$$anonfun$net$liftweb$http$S$$_innerInit$1$
  $anonfun$apply$21.apply(S.scala:1039)
 at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:65)
 at
  net.liftweb.http.S$$anonfun$net$liftweb$http$S$$_innerInit$1.apply
  (S.scala:1038)
 at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:65)
 at net.liftweb.http.S$.net$liftweb$http$S$$_innerInit(S.scala:1037)
 at net.liftweb.http.S$$anonfun$_init$1$$anonfun$apply$29$$anonfun
  $apply$30$$anonfun$apply$31$$anonfun$apply$32.apply(S.scala:1068)
 at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:65)
 at net.liftweb.http.S$$anonfun$_init$1$$anonfun$apply$29$$anonfun
  $apply$30$$anonfun$apply$31.apply(S.scala:1067)
 at net.liftweb.http.RequestVarHandler$.apply(Vars.scala:191)
 at net.liftweb.http.S$$anonfun$_init$1$$anonfun$apply$29$$anonfun
  $apply$30.apply(S.scala:1066)
 at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:65)
 at net.liftweb.http.S$$anonfun$_init$1$$anonfun$apply$29.apply
  (S.scala:1065)
 at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:65)
 at net.liftweb.http.S$$anonfun$_init$1.apply(S.scala:1064)
 at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:65)
 at 

[Lift] Re: Comet request exception

2009-06-04 Thread David Pollak
2009/6/4 feelgood asseliva...@gmail.com


 How can I share my sources? By the way, I use 1.1-SNAPSHOT version of
 Lift


You can mail them to me off-list or post a project on GitHub




 On 4 июн, 02:15, David Pollak feeder.of.the.be...@gmail.com wrote:
  I just tested against 6.1.18 and it works just fine.
 
  Can you post the source of your failing app and a link to your version of
  Jetty and I'll track it down?
 
  Thanks,
 
  David
 
  On Wed, Jun 3, 2009 at 12:19 PM, feelgood asseliva...@gmail.com wrote:
 
   I just copied comet sample named Clock from the p. 142 of the
   liftbook into my app. It doesn't work. First time it renders timestamp
   normally, but since 10 seconds:
 
   WARN - Request for /comet_request/58946720417/1ha35q9iqp4el failed
   Bail
   java.lang.Exception: Bail
  at
 net.liftweb.http.LiftRules$.doContinuation(LiftRules.scala:436)
  at
 net.liftweb.http.LiftServlet.setupContinuation(LiftServlet.scala:
   352)
  at
 net.liftweb.http.LiftServlet.handleComet(LiftServlet.scala:363)
  at net.liftweb.http.LiftServlet.net$liftweb$http$LiftServlet$
   $dispatchStatefulRequest(LiftServlet.scala:232)
  at
 net.liftweb.http.LiftServlet$$anonfun$2.apply(LiftServlet.scala:
   155)
  at
 net.liftweb.http.LiftServlet$$anonfun$2.apply(LiftServlet.scala:
   155)
  at
 net.liftweb.http.S$.net$liftweb$http$S$$wrapQuery(S.scala:908)
  at
   net.liftweb.http.S$$anonfun$net$liftweb$http$S$$_nest2InnerInit$1$
   $anonfun$apply$18.apply(S.scala:1026)
  at net.liftweb.http.S$.net$liftweb$http$S$$doAround(S.scala:845)
  at
 net.liftweb.http.S$$anonfun$net$liftweb$http$S$$doAround$1.apply
   (S.scala:846)
  at net.liftweb.mapper.DB$$anon$1.net
   $liftweb$mapper$DB$$anon$$doWith
   (DB.scala:117)
  at
   net.liftweb.mapper.DB$$anon$1$$anonfun$net$liftweb$mapper$DB$$anon$
   $doWith$1.apply(DB.scala:118)
  at
   net.liftweb.mapper.DB$$anon$1$$anonfun$net$liftweb$mapper$DB$$anon$
   $doWith$1.apply(DB.scala:118)
  at net.liftweb.mapper.DB$.use(DB.scala:305)
  at net.liftweb.mapper.DB$$anon$1.net
   $liftweb$mapper$DB$$anon$$doWith
   (DB.scala:118)
  at net.liftweb.mapper.DB$$anon$1.apply(DB.scala:124)
  at net.liftweb.http.S$.net$liftweb$http$S$$doAround(S.scala:846)
  at
 net.liftweb.http.S$$anonfun$net$liftweb$http$S$$_nest2InnerInit
   $1.apply(S.scala:1024)
  at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:65)
  at
 net.liftweb.http.S$.net$liftweb$http$S$$_nest2InnerInit(S.scala:
   1023)
  at net.liftweb.http.S$$anonfun$net$liftweb$http$S$$_innerInit$1$
   $anonfun$apply$21$$anonfun$apply$22$$anonfun$apply$23$$anonfun$apply
   $24$$anonfun$apply$25$$anonfun$apply$26.apply(S.scala:1044)
  at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:65)
  at net.liftweb.http.S$$anonfun$net$liftweb$http$S$$_innerInit$1$
   $anonfun$apply$21$$anonfun$apply$22$$anonfun$apply$23$$anonfun$apply
   $24$$anonfun$apply$25.apply(S.scala:1043)
  at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:65)
  at net.liftweb.http.S$$anonfun$net$liftweb$http$S$$_innerInit$1$
   $anonfun$apply$21$$anonfun$apply$22$$anonfun$apply$23$$anonfun$apply
   $24.apply(S.scala:1042)
  at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:65)
  at net.liftweb.http.S$$anonfun$net$liftweb$http$S$$_innerInit$1$
   $anonfun$apply$21$$anonfun$apply$22$$anonfun$apply$23.apply(S.scala:
   1041)
  at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:65)
  at net.liftweb.http.S$$anonfun$net$liftweb$http$S$$_innerInit$1$
   $anonfun$apply$21$$anonfun$apply$22.apply(S.scala:1040)
  at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:65)
  at net.liftweb.http.S$$anonfun$net$liftweb$http$S$$_innerInit$1$
   $anonfun$apply$21.apply(S.scala:1039)
  at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:65)
  at
   net.liftweb.http.S$$anonfun$net$liftweb$http$S$$_innerInit$1.apply
   (S.scala:1038)
  at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:65)
  at
 net.liftweb.http.S$.net$liftweb$http$S$$_innerInit(S.scala:1037)
  at
 net.liftweb.http.S$$anonfun$_init$1$$anonfun$apply$29$$anonfun
   $apply$30$$anonfun$apply$31$$anonfun$apply$32.apply(S.scala:1068)
  at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:65)
  at
 net.liftweb.http.S$$anonfun$_init$1$$anonfun$apply$29$$anonfun
   $apply$30$$anonfun$apply$31.apply(S.scala:1067)
  at net.liftweb.http.RequestVarHandler$.apply(Vars.scala:191)
  at
 net.liftweb.http.S$$anonfun$_init$1$$anonfun$apply$29$$anonfun
   $apply$30.apply(S.scala:1066)
  at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:65)
  at net.liftweb.http.S$$anonfun$_init$1$$anonfun$apply$29.apply
   (S.scala:1065)
  at 

[Lift] Re: Comet request exception

2009-06-04 Thread David Pollak
2009/6/4 feelgood asseliva...@gmail.com


 How can I share my sources? By the way, I use 1.1-SNAPSHOT version of
 Lift


You can mail them to me off-list or post a project on GitHub




 On 4 июн, 02:15, David Pollak feeder.of.the.be...@gmail.com wrote:
  I just tested against 6.1.18 and it works just fine.
 
  Can you post the source of your failing app and a link to your version of
  Jetty and I'll track it down?
 
  Thanks,
 
  David
 
  On Wed, Jun 3, 2009 at 12:19 PM, feelgood asseliva...@gmail.com wrote:
 
   I just copied comet sample named Clock from the p. 142 of the
   liftbook into my app. It doesn't work. First time it renders timestamp
   normally, but since 10 seconds:
 
   WARN - Request for /comet_request/58946720417/1ha35q9iqp4el failed
   Bail
   java.lang.Exception: Bail
  at
 net.liftweb.http.LiftRules$.doContinuation(LiftRules.scala:436)
  at
 net.liftweb.http.LiftServlet.setupContinuation(LiftServlet.scala:
   352)
  at
 net.liftweb.http.LiftServlet.handleComet(LiftServlet.scala:363)
  at net.liftweb.http.LiftServlet.net$liftweb$http$LiftServlet$
   $dispatchStatefulRequest(LiftServlet.scala:232)
  at
 net.liftweb.http.LiftServlet$$anonfun$2.apply(LiftServlet.scala:
   155)
  at
 net.liftweb.http.LiftServlet$$anonfun$2.apply(LiftServlet.scala:
   155)
  at
 net.liftweb.http.S$.net$liftweb$http$S$$wrapQuery(S.scala:908)
  at
   net.liftweb.http.S$$anonfun$net$liftweb$http$S$$_nest2InnerInit$1$
   $anonfun$apply$18.apply(S.scala:1026)
  at net.liftweb.http.S$.net$liftweb$http$S$$doAround(S.scala:845)
  at
 net.liftweb.http.S$$anonfun$net$liftweb$http$S$$doAround$1.apply
   (S.scala:846)
  at net.liftweb.mapper.DB$$anon$1.net
   $liftweb$mapper$DB$$anon$$doWith
   (DB.scala:117)
  at
   net.liftweb.mapper.DB$$anon$1$$anonfun$net$liftweb$mapper$DB$$anon$
   $doWith$1.apply(DB.scala:118)
  at
   net.liftweb.mapper.DB$$anon$1$$anonfun$net$liftweb$mapper$DB$$anon$
   $doWith$1.apply(DB.scala:118)
  at net.liftweb.mapper.DB$.use(DB.scala:305)
  at net.liftweb.mapper.DB$$anon$1.net
   $liftweb$mapper$DB$$anon$$doWith
   (DB.scala:118)
  at net.liftweb.mapper.DB$$anon$1.apply(DB.scala:124)
  at net.liftweb.http.S$.net$liftweb$http$S$$doAround(S.scala:846)
  at
 net.liftweb.http.S$$anonfun$net$liftweb$http$S$$_nest2InnerInit
   $1.apply(S.scala:1024)
  at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:65)
  at
 net.liftweb.http.S$.net$liftweb$http$S$$_nest2InnerInit(S.scala:
   1023)
  at net.liftweb.http.S$$anonfun$net$liftweb$http$S$$_innerInit$1$
   $anonfun$apply$21$$anonfun$apply$22$$anonfun$apply$23$$anonfun$apply
   $24$$anonfun$apply$25$$anonfun$apply$26.apply(S.scala:1044)
  at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:65)
  at net.liftweb.http.S$$anonfun$net$liftweb$http$S$$_innerInit$1$
   $anonfun$apply$21$$anonfun$apply$22$$anonfun$apply$23$$anonfun$apply
   $24$$anonfun$apply$25.apply(S.scala:1043)
  at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:65)
  at net.liftweb.http.S$$anonfun$net$liftweb$http$S$$_innerInit$1$
   $anonfun$apply$21$$anonfun$apply$22$$anonfun$apply$23$$anonfun$apply
   $24.apply(S.scala:1042)
  at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:65)
  at net.liftweb.http.S$$anonfun$net$liftweb$http$S$$_innerInit$1$
   $anonfun$apply$21$$anonfun$apply$22$$anonfun$apply$23.apply(S.scala:
   1041)
  at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:65)
  at net.liftweb.http.S$$anonfun$net$liftweb$http$S$$_innerInit$1$
   $anonfun$apply$21$$anonfun$apply$22.apply(S.scala:1040)
  at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:65)
  at net.liftweb.http.S$$anonfun$net$liftweb$http$S$$_innerInit$1$
   $anonfun$apply$21.apply(S.scala:1039)
  at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:65)
  at
   net.liftweb.http.S$$anonfun$net$liftweb$http$S$$_innerInit$1.apply
   (S.scala:1038)
  at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:65)
  at
 net.liftweb.http.S$.net$liftweb$http$S$$_innerInit(S.scala:1037)
  at
 net.liftweb.http.S$$anonfun$_init$1$$anonfun$apply$29$$anonfun
   $apply$30$$anonfun$apply$31$$anonfun$apply$32.apply(S.scala:1068)
  at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:65)
  at
 net.liftweb.http.S$$anonfun$_init$1$$anonfun$apply$29$$anonfun
   $apply$30$$anonfun$apply$31.apply(S.scala:1067)
  at net.liftweb.http.RequestVarHandler$.apply(Vars.scala:191)
  at
 net.liftweb.http.S$$anonfun$_init$1$$anonfun$apply$29$$anonfun
   $apply$30.apply(S.scala:1066)
  at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:65)
  at net.liftweb.http.S$$anonfun$_init$1$$anonfun$apply$29.apply
   (S.scala:1065)
  at 

[Lift] Re: directives versus snippets

2009-06-04 Thread Matt Williams

 There's a dispatcher in Lift and it checks for user-supplied snippets before
 dispatching to the hard-coded snippet names.

Is this actually the case?

I have tried to replace the buiiltin snippet for Msgs in order to
embed a span within the list items, but I needed to use a different
name for the class, as it was still rendering using the builtin.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] NULLable MappedForeignKey

2009-06-04 Thread DavidV

What is the proper way to create a MappedForeignKey that is optional?

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: NULLable MappedForeignKey

2009-06-04 Thread David Pollak
All MappedForeignKeys are Nullable.
If you've got
object theUser extends MappedLongForeignKey(this, User)

You can set the field to null with:

theUser(Empty)

Does that help?

On Thu, Jun 4, 2009 at 8:21 AM, DavidV david.v.villa...@gmail.com wrote:


 What is the proper way to create a MappedForeignKey that is optional?

 



-- 
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Git some: http://github.com/dpp

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: directives versus snippets

2009-06-04 Thread David Pollak
In order to override a built-in snippet, you must do:
LiftRules.snippetDispatch.prepend{
  case Msgs | msgs = 
}

in Boot.  The LiftRules snippet dispatch table is consulted first, before
the by convention reflection-based snippet dispatching is invoked.  This
enhances performance.

On Thu, Jun 4, 2009 at 8:14 AM, Matt Williams m...@makeable.co.uk wrote:


  There's a dispatcher in Lift and it checks for user-supplied snippets
 before
  dispatching to the hard-coded snippet names.

 Is this actually the case?

 I have tried to replace the buiiltin snippet for Msgs in order to
 embed a span within the list items, but I needed to use a different
 name for the class, as it was still rendering using the builtin.

 



-- 
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Git some: http://github.com/dpp

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: how to serve html fragments

2009-06-04 Thread David Pollak
Okay... checked in a change that removes the ?...? XML header as well

On Thu, Jun 4, 2009 at 6:57 AM, David Pollak
feeder.of.the.be...@gmail.comwrote:



 On Thu, Jun 4, 2009 at 12:10 AM, fatu fab...@gmail.com wrote:


 Yes it does indeed. Sorry, I was getting confused by the fact that
 Firefox still doesn't like the fragment but it happens both when using
 a view and when using a template + snippet. The DOCTYPE is indeed
 missing in both cases when S.skipDocType is on, I guess what's still
 causing trouble is the fact that the XML declaration is still there.

 I think I can remember seeing somewhere (group? blogs?) another flag
 that, when turned on, would skip the XML declaration but I can't find
 it right now. Is there really such a thing or did I only dream about
 it?


 Lemme see what I can do.




 Thanks.

 On 3 Giu, 17:57, David Pollak feeder.of.the.be...@gmail.com wrote:
  On Wed, Jun 3, 2009 at 7:40 AM, fatu fab...@gmail.com wrote:
 
   ...Another question for now :-)
 
   Does it work for views as well?
 
  It should.  Views are treated just like static XHTML files... a source
 of
  NodeSeq
 
 
 
 
 
   Many thanks.
 
   Fabio
 
   On 21 Mag, 15:38, David Pollak feeder.of.the.be...@gmail.com wrote:
On Thu, May 21, 2009 at 12:27 AM, fatu fab...@gmail.com wrote:
 
 Right, didn't think about that alternative.
 
 Thanks and best compliments to you and all the active Lift
 community
 for this superb Scala framework! I really think (and hope) it's
 going
 to have a big impact and a tremendous popularity rise in the next
 months, especially with more forthcoming books and articles
 spreading
 the word.
 
We ask two things: build cool apps in Lift and be part of this
 community,
asking and answering questions.
 
Thanks!
 
 On 21 Mag, 06:42, David Pollak feeder.of.the.be...@gmail.com
 wrote:
  On Wed, May 20, 2009 at 8:38 PM, fatu fab...@gmail.com wrote:
 
   Hi David,
 
   yes it will do, thank you so much for such a lightning-fast
   development in reply!
 
   I'm only thinking about a case that is probably much more of
 an
   exception than a rule, i.e. when the snippet dynamically
 decides if
   it
   needs to generate a full page or a fragment (which is not a
 very
   good
   design anyway IMHO), for example based on some info passed.
 But
   even
   in that case the snippet will know that and will be able to
 set
   S.skipDocType = true accordingly, so it should be perfectly
 fine.
   Plus
   it won't be difficult at all to make the processing diverge in
 the
   2
   cases by using URL rewrites, redirecting it to a different
 template
   /
   snippet depending on parameters or URL structure, which is
 probably
   a
   better design too.
 
  You could also pass a header flag from your AJAX call.  If the
   header's
 set,
  you don't do the boilerplate surround that'll include all the
 html,
 head
  and body tags.
 
  Anyway, enjoy and thanks for the use case.
 
  Party on.
 
   Again many thanks everyone and David especially!
 
   On May 20, 4:05 pm, David Pollak 
 feeder.of.the.be...@gmail.com
   wrote:
I'm about to commit S.skipDocType = true | false.  If you
 set it
   to
 true,
the !DOCTYPE .../ will be omitted from the response page.
  This
 will
   allow
your AJAX fragements to pull parts of pages from the server.
Note
 that
someplace in your snippets, you'll have to set S.skipDocType
 =
   true.
 
Does this address your issue?
 
On Wed, May 20, 2009 at 5:13 AM, fatu fab...@gmail.com
 wrote:
 
 Hi Marius,
 
 as I understand them, Jx classes help in generating JS
 that can
 itself
 generate DOM at the client.  Am I wrong? I'd really like
 to
   serve
 back
 an HTML fragment built by using the normal Lift template
   pipeline
 (so
 including surround  bind). Is that possible?
 
 Thanks
 
 On 20 Mag, 13:16, marius d. marius.dan...@gmail.com
 wrote:
  As I understood you want to make an Ajax request and
 serve
   back a
  Document Fragment. If so please also take a look at Jx
 stuff.
   We
  discuss Jx classes in a fairly amount of details in the
 lift
 book.
 
  Br's,
  Marius
 
  On May 20, 9:32 am, fatu fab...@gmail.com wrote:
 
   Timothy,
 
   thanks for the links, I found them useful and I find
 your
   blog
 in
   general very interesting. Came across scala-blogs.organd
   it
 looks
   quite promising as well.
 
   I knew bind already from the Exploring Lift book
 which
   I
 pull
   from
   git, build with Lyx and keep at hand regularly. In the
   doctype
   post,
   though, I couldn't find a way to specify no doctype
which I
   think
   is necessary to serve a fragment; plus 

[Lift] Re: how to serve html fragments

2009-06-04 Thread Timothy Perrett

Have you pushed this change? Its not showing on github?

Cheers, Tim

On 04/06/2009 17:33, David Pollak feeder.of.the.be...@gmail.com wrote:

 Okay... checked in a change that removes the ?...? XML header as well


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: how to serve html fragments

2009-06-04 Thread David Pollak
On Thu, Jun 4, 2009 at 10:04 AM, Timothy Perrett timo...@getintheloop.euwrote:


 Have you pushed this change? Its not showing on github?


I pushed, but forgot to commit... :-)  That's me, I just can't commit.

All committed and pushed.




 Cheers, Tim

 On 04/06/2009 17:33, David Pollak feeder.of.the.be...@gmail.com wrote:

 Okay... checked in a change that removes the ?...? XML header as well


 



-- 
Lift, the simply functional web framework http://liftweb.net
Beginning Scala http://www.apress.com/book/view/1430219890
Follow me: http://twitter.com/dpp
Git some: http://github.com/dpp

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: Is something up with applying By to a MappedBoolean?

2009-06-04 Thread E. Biggs

here's my derby log:

Cannot find the network server class,
org.apache.derby.impl.drda.NetworkServerControlImpl. Your class path
should contain derbynet.jar.

2009-06-03 02:18:26.023 GMT:
 Booting Derby version The Apache Software Foundation - Apache Derby -
10.4.2.0 - (689064): instance a816c00e-0121-a3e9-03ce-00c22fe0
on database directory /Users/ebiggs/Documents/workspace/maps/
lift_example

Database Class Loader started - derby.database.classpath=''
2009-06-03 02:18:27.693 GMT Thread[Thread-14,5,main] (XID = 437),
(SESSIONID = 0), (DATABASE = lift_example), (DRDAID = null), Cleanup
action starting
2009-06-03 02:18:27.693 GMT Thread[Thread-14,5,main] (XID = 437),
(SESSIONID = 0), (DATABASE = lift_example), (DRDAID = null), Failed
Statement is: SELECT  DISTINCT Property.id, Property.propertygroup,
Property.streetnumber, Property.street, Property.unit, Property.city,
Property.state, Property.zip, Property.price, Property.dom,
Property.beds, Property.baths, Property.lotsize, Property.sqft,
Property.status, Property.orgprice, Property.proptype,
Property.numpricechanges, Property.spop, Property.dollarstosqft,
Property.yearbuilt, Property.date_c, Property.geocodesuccess,
Property.lat, Property.long_c, Property.geocodeattempted FROM
Property   WHERE geocodeattempted = ?
java.lang.NullPointerException
at java.io.StringReader.init(StringReader.java:33)
at org.apache.derby.impl.services.uuid.BasicUUID.init(Unknown
Source)
at org.apache.derby.impl.services.uuid.BasicUUIDFactory.recreateUUID
(Unknown Source)
at
org.apache.derby.impl.sql.catalog.SYSCONGLOMERATESRowFactory.buildDescriptor
(Unknown Source)
at
org.apache.derby.impl.sql.catalog.DataDictionaryImpl.getDescriptorViaIndexMinion
(Unknown Source)
at
org.apache.derby.impl.sql.catalog.DataDictionaryImpl.getDescriptorViaIndex
(Unknown Source)
at
org.apache.derby.impl.sql.catalog.DataDictionaryImpl.getConglomerateDescriptorsScan
(Unknown Source)
at
org.apache.derby.impl.sql.catalog.DataDictionaryImpl.finishTableDescriptor
(Unknown Source)
at
org.apache.derby.impl.sql.catalog.DataDictionaryImpl.getTableDescriptorIndex1Scan
(Unknown Source)
at
org.apache.derby.impl.sql.catalog.DataDictionaryImpl.getUncachedTableDescriptor
(Unknown Source)
at org.apache.derby.impl.sql.catalog.NameTDCacheable.setIdentity
(Unknown Source)
at org.apache.derby.impl.services.cache.ConcurrentCache.find(Unknown
Source)
at
org.apache.derby.impl.sql.catalog.DataDictionaryImpl.getTableDescriptor
(Unknown Source)
at org.apache.derby.impl.sql.compile.QueryTreeNode.getTableDescriptor
(Unknown Source)
at org.apache.derby.impl.sql.compile.FromBaseTable.bindTableDescriptor
(Unknown Source)
at org.apache.derby.impl.sql.compile.FromBaseTable.bindNonVTITables
(Unknown Source)
at org.apache.derby.impl.sql.compile.FromList.bindTables(Unknown
Source)
at org.apache.derby.impl.sql.compile.SelectNode.bindNonVTITables
(Unknown Source)
at org.apache.derby.impl.sql.compile.DMLStatementNode.bindTables
(Unknown Source)
at org.apache.derby.impl.sql.compile.DMLStatementNode.bind(Unknown
Source)
at org.apache.derby.impl.sql.compile.CursorNode.bindStatement(Unknown
Source)
at org.apache.derby.impl.sql.GenericStatement.prepMinion(Unknown
Source)
at org.apache.derby.impl.sql.GenericStatement.prepare(Unknown Source)
at
org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement
(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedPreparedStatement.init(Unknown
Source)
at org.apache.derby.impl.jdbc.EmbedPreparedStatement20.init(Unknown
Source)
at org.apache.derby.impl.jdbc.EmbedPreparedStatement30.init(Unknown
Source)
at org.apache.derby.jdbc.Driver30.newEmbedPreparedStatement(Unknown
Source)
at org.apache.derby.impl.jdbc.EmbedConnection.prepareStatement
(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedConnection.prepareStatement
(Unknown Source)
at net.liftweb.mapper.DB$$anonfun$prepareStatement$1.apply(DB.scala:
278)
at net.liftweb.mapper.DB$$anonfun$prepareStatement$1.apply(DB.scala:
277)
at net.liftweb.util.TimeHelpers$class.calcTime(TimeHelpers.scala:241)
at net.liftweb.util.Helpers$.calcTime(Helpers.scala:29)
at net.liftweb.mapper.DB$.prepareStatement(DB.scala:277)
at net.liftweb.mapper.MetaMapper$$anonfun$findMapFieldDb$1.apply
(MetaMapper.scala:306)
at net.liftweb.mapper.MetaMapper$$anonfun$findMapFieldDb$1.apply
(MetaMapper.scala:298)
at net.liftweb.mapper.DB$.use(DB.scala:305)
at net.liftweb.mapper.MetaMapper$class.findMapFieldDb
(MetaMapper.scala:297)
at com.yo.model.Property$.findMapFieldDb(Property.scala:5)
at net.liftweb.mapper.MetaMapper$class.findMapDb(MetaMapper.scala:
293)

[Lift] Re: NULLable MappedForeignKey

2009-06-04 Thread Joe Wass

Just to check -- are you familiar with the difference between option
types and null references in scala? It's an important distinction and
it's very important with Lift.

Joe

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: Issue #12

2009-06-04 Thread Derek Chen-Becker
I just checked in some code in the wip-dcb-mapper-datetime branch on
e9a2f3f85e99e5e4f53611e6892830b9878d4f9a. I've tested with Derby, H2, MySQL
and PostgreSQL, so I'm pretty confident that this is working. I have a
little test project that someone could use if they want to test against
Oracle or SQL Server.

Derek

On Wed, Jun 3, 2009 at 9:08 PM, David Pollak
feeder.of.the.be...@gmail.comwrote:



 On Wed, Jun 3, 2009 at 3:56 PM, Derek Chen-Becker 
 dchenbec...@gmail.comwrote:

 I'm looking at issue #12:

 http://github.com/dpp/liftweb/issues#issue/12

 I think I've tracked it down to an issue with the way Mapper handles date
 and time data. Mapper doesn't use setTimestamp anywhere for prepared
 statements, only setDate or setObject. The issue is that SQL Dates really
 are just dates, not date + time. In particular, MappedDateTime's
 jdbcFriendly and real_convertToJDBCFriendly methods are returning
 java.sql.Dates, when they really should return java.sql.Timestamps. Also,
 DB.runQuery uses a setDate instead of setTimestamp when the passed parameter
 type is java.util.Date, and MetaMapper's BySql clause uses java.sql.Date.
 The MetaMapper.save method uses st.setObject to set field values when
 inserting and/or updating, and passes the java.sql.Types parameter
 (TIMESTAMP, for MappedDateTime), but Derby is discarding the time portion.
 This may also be a bug in Derby, but I don't think that we should be using
 java.sql.Date for a TIMESTAMP field, either. Unless anyone has objections, I
 propose that:


1. The jdbcFriendly and convert_real... methods on MappedDateTime be
changed to return java.sql.Timestamp instead of java.sql.Date
2. Change the BySQL clause to use a setTimestamp for the parameter if
the passed data is java.sql.Timestamp or java.util.Date, and use setDate
only if the passed data is already java.sql.Date. That way people can be
more explicit about which type they actually want
3. Make a similar change to DB.runQuery's parameter handling
4. Add a MappedDate and MappedTime for people who explicitly only want
a Date or Time respectively

 Thoughts? I'll go ahead and get this done this week unless anyone can
 explain why we wouldn't want to do this.


 Sounds like a great analysis.  Looking forward to the fixes.




 Derek





 --
 Lift, the simply functional web framework http://liftweb.net
 Beginning Scala http://www.apress.com/book/view/1430219890
 Follow me: http://twitter.com/dpp
 Git some: http://github.com/dpp

 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: directives versus snippets

2009-06-04 Thread Matt Williams

Thank you David.

Hello by the way, and thank you for such a graceful framework.

Matt

On Jun 4, 5:21 pm, David Pollak feeder.of.the.be...@gmail.com wrote:
 In order to override a built-in snippet, you must do:
 LiftRules.snippetDispatch.prepend{
   case Msgs | msgs = 

 }

 in Boot.  The LiftRules snippet dispatch table is consulted first, before
 the by convention reflection-based snippet dispatching is invoked.  This
 enhances performance.

 On Thu, Jun 4, 2009 at 8:14 AM, Matt Williams m...@makeable.co.uk wrote:

   There's a dispatcher in Lift and it checks for user-supplied snippets
  before
   dispatching to the hard-coded snippet names.

  Is this actually the case?

  I have tried to replace the buiiltin snippet for Msgs in order to
  embed a span within the list items, but I needed to use a different
  name for the class, as it was still rendering using the builtin.

 --
 Lift, the simply functional web frameworkhttp://liftweb.net
 Beginning Scalahttp://www.apress.com/book/view/1430219890
 Follow me:http://twitter.com/dpp
 Git some:http://github.com/dpp

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: Comet request exception

2009-06-04 Thread David Pollak
Folks,

Thanks to Greg Wilkins (Jetty author) who helped out with this, the
RunWebApp.scala file should look like:
import _root_.org.mortbay.jetty.Connector
import _root_.org.mortbay.jetty.Server
import _root_.org.mortbay.jetty.webapp.WebAppContext
import org.mortbay.jetty.nio._

object RunWebApp extends Application {
  val server = new Server
  val scc = new SelectChannelConnector
  scc.setPort(8080)
  server.setConnectors(Array(scc))

  val context = new WebAppContext()
  context.setServer(server)
  context.setContextPath(/)
  context.setWar(src/main/webapp)

  server.addHandler(context)

  try {
println( STARTING EMBEDDED JETTY SERVER, PRESS ANY KEY TO STOP)
server.start()
while (System.in.available() == 0) {
  Thread.sleep(5000)
}
server.stop()
server.join()
  } catch {
case exc : Exception = {
  exc.printStackTrace()
  System.exit(100)
}
  }
}

Using the SelectChangeConnector fixes the problem.

I've updated the Lift source.

Thanks,

David

2009/6/4 David Pollak feeder.of.the.be...@gmail.com



 2009/6/4 feelgood asseliva...@gmail.com


 How can I share my sources? By the way, I use 1.1-SNAPSHOT version of
 Lift


 You can mail them to me off-list or post a project on GitHub




 On 4 июн, 02:15, David Pollak feeder.of.the.be...@gmail.com wrote:
  I just tested against 6.1.18 and it works just fine.
 
  Can you post the source of your failing app and a link to your version
 of
  Jetty and I'll track it down?
 
  Thanks,
 
  David
 
  On Wed, Jun 3, 2009 at 12:19 PM, feelgood asseliva...@gmail.com
 wrote:
 
   I just copied comet sample named Clock from the p. 142 of the
   liftbook into my app. It doesn't work. First time it renders timestamp
   normally, but since 10 seconds:
 
   WARN - Request for /comet_request/58946720417/1ha35q9iqp4el failed
   Bail
   java.lang.Exception: Bail
  at
 net.liftweb.http.LiftRules$.doContinuation(LiftRules.scala:436)
  at
 net.liftweb.http.LiftServlet.setupContinuation(LiftServlet.scala:
   352)
  at
 net.liftweb.http.LiftServlet.handleComet(LiftServlet.scala:363)
  at net.liftweb.http.LiftServlet.net$liftweb$http$LiftServlet$
   $dispatchStatefulRequest(LiftServlet.scala:232)
  at
 net.liftweb.http.LiftServlet$$anonfun$2.apply(LiftServlet.scala:
   155)
  at
 net.liftweb.http.LiftServlet$$anonfun$2.apply(LiftServlet.scala:
   155)
  at
 net.liftweb.http.S$.net$liftweb$http$S$$wrapQuery(S.scala:908)
  at
   net.liftweb.http.S$$anonfun$net$liftweb$http$S$$_nest2InnerInit$1$
   $anonfun$apply$18.apply(S.scala:1026)
  at
 net.liftweb.http.S$.net$liftweb$http$S$$doAround(S.scala:845)
  at
 net.liftweb.http.S$$anonfun$net$liftweb$http$S$$doAround$1.apply
   (S.scala:846)
  at net.liftweb.mapper.DB$$anon$1.net
   $liftweb$mapper$DB$$anon$$doWith
   (DB.scala:117)
  at
   net.liftweb.mapper.DB$$anon$1$$anonfun$net$liftweb$mapper$DB$$anon$
   $doWith$1.apply(DB.scala:118)
  at
   net.liftweb.mapper.DB$$anon$1$$anonfun$net$liftweb$mapper$DB$$anon$
   $doWith$1.apply(DB.scala:118)
  at net.liftweb.mapper.DB$.use(DB.scala:305)
  at net.liftweb.mapper.DB$$anon$1.net
   $liftweb$mapper$DB$$anon$$doWith
   (DB.scala:118)
  at net.liftweb.mapper.DB$$anon$1.apply(DB.scala:124)
  at
 net.liftweb.http.S$.net$liftweb$http$S$$doAround(S.scala:846)
  at
 net.liftweb.http.S$$anonfun$net$liftweb$http$S$$_nest2InnerInit
   $1.apply(S.scala:1024)
  at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:65)
  at
 net.liftweb.http.S$.net$liftweb$http$S$$_nest2InnerInit(S.scala:
   1023)
  at
 net.liftweb.http.S$$anonfun$net$liftweb$http$S$$_innerInit$1$
   $anonfun$apply$21$$anonfun$apply$22$$anonfun$apply$23$$anonfun$apply
   $24$$anonfun$apply$25$$anonfun$apply$26.apply(S.scala:1044)
  at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:65)
  at
 net.liftweb.http.S$$anonfun$net$liftweb$http$S$$_innerInit$1$
   $anonfun$apply$21$$anonfun$apply$22$$anonfun$apply$23$$anonfun$apply
   $24$$anonfun$apply$25.apply(S.scala:1043)
  at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:65)
  at
 net.liftweb.http.S$$anonfun$net$liftweb$http$S$$_innerInit$1$
   $anonfun$apply$21$$anonfun$apply$22$$anonfun$apply$23$$anonfun$apply
   $24.apply(S.scala:1042)
  at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:65)
  at
 net.liftweb.http.S$$anonfun$net$liftweb$http$S$$_innerInit$1$
   $anonfun$apply$21$$anonfun$apply$22$$anonfun$apply$23.apply(S.scala:
   1041)
  at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:65)
  at
 net.liftweb.http.S$$anonfun$net$liftweb$http$S$$_innerInit$1$
   $anonfun$apply$21$$anonfun$apply$22.apply(S.scala:1040)
  at net.liftweb.util.ThreadGlobal.doWith(ThreadGlobal.scala:65)
  at
 net.liftweb.http.S$$anonfun$net$liftweb$http$S$$_innerInit$1$