[Lift] Re: Still confused about redirects

2009-01-24 Thread David Pollak
On Sat, Jan 24, 2009 at 2:32 PM, Charles F. Munat  wrote:

>
> Ah, that's a clever idea.


:-)


>
>
> Chas.
>
> David Pollak wrote:
> > Charles,
> >
> > Place the following lines in Boot.scala:
> >
> > LiftRules.passNotFoundToChain = false
> > LiftRules.uriNotFound.prepend {
> >   case (r, _) => PermRedirectResponse("/", r)
> > }
> >
> > This will work in 0.11-SNAPSHOT (there was a bug in 0.10 that prevents
> > it from working).
> >
> > Any URL not found will be redirected to "/".
> >
> > Please wait an hour for the fix to propagate through Hudson and
> > scala-tools.org .
> >
> > Thanks,
> >
> > David
> >
> > On Sat, Jan 24, 2009 at 11:35 AM, Charles F. Munat  > > wrote:
> >
> >
> > All my templates are index.html. I use the folder name. And I never
> call
> > them by index (I rewrote the Menu functions to avoid that). So I call
> > /the_book/ and I get /the_book/index.html. But if someone entered
> > /the_book/index.html, I'd still want it to work.
> >
> > But you've made me realize that this might work:
> >
> > LiftRules.dispatch.prepend {
> >   case r @ Req(page :: Nil, "html", _) => if (page != "index") =>
> >Full(PermRedirectResponse("/", r))
> > }
> >
> > That said, using this one I give up specific redirects in favor of
> > sending everything to the home page. I think I like the other one
> > better.
> >
> > Thanks for all your help!
> >
> > Chas.
> >
> > Tim Perrett wrote:
> >  > When you say all your pages are index.html, how do you mean? if
> your
> >  > file is index.html, in lift the URI would be /index right?
> >  >
> >  >
> >  >> Anyway, this helps a lot. So if I want to redirect thebook.html
> to
> >  >> /the_book/ I would do this:
> >  >>
> >  >> LiftRules.dispatch.prepend {
> >  >>case r @ Req("thebook" :: Nil, "html", _) => () => Full(
> >  >>  PermRedirectResponse("/the_book", r))
> >  >>
> >  >
> >  > Correct :-)
> >  >
> >  >
> >  >
> >  > >
> >
> >
> >
> >
> >
> > --
> > Lift, the simply functional web framework http://liftweb.net
> > Collaborative Task Management http://much4.us
> > Follow me: http://twitter.com/dpp
> > Git some: http://github.com/dpp
> >
> > >
>
> >
>


-- 
Lift, the simply functional web framework http://liftweb.net
Collaborative Task Management http://much4.us
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: Still confused about redirects

2009-01-24 Thread Charles F. Munat

Ah, that's a clever idea.

Chas.

David Pollak wrote:
> Charles,
> 
> Place the following lines in Boot.scala:
> 
> LiftRules.passNotFoundToChain = false
> LiftRules.uriNotFound.prepend {
>   case (r, _) => PermRedirectResponse("/", r)
> }
> 
> This will work in 0.11-SNAPSHOT (there was a bug in 0.10 that prevents 
> it from working).
> 
> Any URL not found will be redirected to "/".
> 
> Please wait an hour for the fix to propagate through Hudson and 
> scala-tools.org .
> 
> Thanks,
> 
> David
> 
> On Sat, Jan 24, 2009 at 11:35 AM, Charles F. Munat  > wrote:
> 
> 
> All my templates are index.html. I use the folder name. And I never call
> them by index (I rewrote the Menu functions to avoid that). So I call
> /the_book/ and I get /the_book/index.html. But if someone entered
> /the_book/index.html, I'd still want it to work.
> 
> But you've made me realize that this might work:
> 
> LiftRules.dispatch.prepend {
>   case r @ Req(page :: Nil, "html", _) => if (page != "index") =>
>Full(PermRedirectResponse("/", r))
> }
> 
> That said, using this one I give up specific redirects in favor of
> sending everything to the home page. I think I like the other one
> better.
> 
> Thanks for all your help!
> 
> Chas.
> 
> Tim Perrett wrote:
>  > When you say all your pages are index.html, how do you mean? if your
>  > file is index.html, in lift the URI would be /index right?
>  >
>  >
>  >> Anyway, this helps a lot. So if I want to redirect thebook.html to
>  >> /the_book/ I would do this:
>  >>
>  >> LiftRules.dispatch.prepend {
>  >>case r @ Req("thebook" :: Nil, "html", _) => () => Full(
>  >>  PermRedirectResponse("/the_book", r))
>  >>
>  >
>  > Correct :-)
>  >
>  >
>  >
>  > >
> 
> 
> 
> 
> 
> -- 
> Lift, the simply functional web framework http://liftweb.net
> Collaborative Task Management http://much4.us
> 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: Still confused about redirects

2009-01-24 Thread David Pollak
Charles,

Place the following lines in Boot.scala:

LiftRules.passNotFoundToChain = false
LiftRules.uriNotFound.prepend {
  case (r, _) => PermRedirectResponse("/", r)
}

This will work in 0.11-SNAPSHOT (there was a bug in 0.10 that prevents it
from working).

Any URL not found will be redirected to "/".

Please wait an hour for the fix to propagate through Hudson and
scala-tools.org.

Thanks,

David

On Sat, Jan 24, 2009 at 11:35 AM, Charles F. Munat  wrote:

>
> All my templates are index.html. I use the folder name. And I never call
> them by index (I rewrote the Menu functions to avoid that). So I call
> /the_book/ and I get /the_book/index.html. But if someone entered
> /the_book/index.html, I'd still want it to work.
>
> But you've made me realize that this might work:
>
> LiftRules.dispatch.prepend {
>   case r @ Req(page :: Nil, "html", _) => if (page != "index") =>
>Full(PermRedirectResponse("/", r))
> }
>
> That said, using this one I give up specific redirects in favor of
> sending everything to the home page. I think I like the other one better.
>
> Thanks for all your help!
>
> Chas.
>
> Tim Perrett wrote:
> > When you say all your pages are index.html, how do you mean? if your
> > file is index.html, in lift the URI would be /index right?
> >
> >
> >> Anyway, this helps a lot. So if I want to redirect thebook.html to
> >> /the_book/ I would do this:
> >>
> >> LiftRules.dispatch.prepend {
> >>case r @ Req("thebook" :: Nil, "html", _) => () => Full(
> >>  PermRedirectResponse("/the_book", r))
> >>
> >
> > Correct :-)
> >
> >
> >
> > >
>
> >
>


-- 
Lift, the simply functional web framework http://liftweb.net
Collaborative Task Management http://much4.us
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: Still confused about redirects

2009-01-24 Thread Charles F. Munat

All my templates are index.html. I use the folder name. And I never call 
them by index (I rewrote the Menu functions to avoid that). So I call 
/the_book/ and I get /the_book/index.html. But if someone entered 
/the_book/index.html, I'd still want it to work.

But you've made me realize that this might work:

LiftRules.dispatch.prepend {
   case r @ Req(page :: Nil, "html", _) => if (page != "index") =>
Full(PermRedirectResponse("/", r))
}

That said, using this one I give up specific redirects in favor of 
sending everything to the home page. I think I like the other one better.

Thanks for all your help!

Chas.

Tim Perrett wrote:
> When you say all your pages are index.html, how do you mean? if your
> file is index.html, in lift the URI would be /index right?
> 
> 
>> Anyway, this helps a lot. So if I want to redirect thebook.html to
>> /the_book/ I would do this:
>>
>> LiftRules.dispatch.prepend {
>>case r @ Req("thebook" :: Nil, "html", _) => () => Full(
>>  PermRedirectResponse("/the_book", r))
>>
> 
> Correct :-)
> 
> 
> 
> > 

--~--~-~--~~~---~--~~
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: web logic

2009-01-24 Thread Marius

:-) ...I'm aware Weblogic plays an important I used to use it quite a
bit(8.x,9.x and now 10). But in so many ways is sooo slow (. Taken a
web application that doesn't need much but JNDI and servlets comparing
Jetty bootstraps so much faster the Weblogic (not to mention memory
footprint). Actually using Weblogic for development was unbelievable
slow. But let's say some can live with slow bootstrap (which during
development is such a waste even when using JavaRebel you sometimes
still need to restart) I've seem better application performance on
Tomcat then WL (slightly similar JVM hotspot settings). I know there
are so many settings that would impact performance in terms of GC,
HotSpot JRockit etc. but still Weblogic is like a mammoth comparing
with say JBoss or other "full" JEE containers. And I've seen it so
many times chosen mostly because of the brand and not what actually
brings on the table. Comparing the goodies from WL with other
container it really doesn't bring much benefits. Configuring WL is
sometimes such a pain. For instance configuring SSL with self signed
certificates (cause during development not everyone has CA-ed
certificates) can be quite a tricky thing to do.

Since 1998 there are about 10 years so maybe things changed a bit
since then. Besides back then J2EE was quite immature (1.2 version ?
with all those entity beans used by everyone for everything ...).
Sorry for touching your heart Dave not my intention but I'm just
talking based on the experience since I have no reason for "love" one
JEE container or another.

Br's,
Marius

On Jan 24, 7:33 pm, David Pollak 
wrote:
> On Sat, Jan 24, 2009 at 6:25 AM, Marius  wrote:
>
> > Whiew ... thank God the topic is split in two words  ...
>
> Personal bias on my part (I was an early user of WebLogic's T3 [Tengah
> [WebLogic]] and am friends with a bunch of the founders), but I believe that
> WebLogic was an extremely important part of making Java and the JVM the
> default for building and deploying server-side code in enterprise.
>
> I haven't used WebLogic since 1998 (pre BEA acquisition), but at that time,
> WebLogic was the best thing going for deploying server-side code.
>
> Sorry for the rant... but... well... there's a very warm spot in my heart
> for WebLogic.
>
>
>
>
>
> > On Jan 23, 8:03 pm, David Pollak 
> > wrote:
> > > On Fri, Jan 23, 2009 at 9:29 AM, Meredith Gregory
> > > wrote:
>
> > > > David,
>
> > > > i just noticed this paragraph.
>
> > > > Perhaps some sort of pi-calculus based way of describing web app logic
> > > >> would allow for better reasoning.  I've noodled with doing some sort
> > of
> > > >> stuff with pi-calculus in Lift.  I stopped the exploration because I
> > was
> > > >> unable to find reasonable language constructs to express what I wanted
> > > >> economically and in a way that a Rails or Struts or Wicket developer
> > could
> > > >> pick up reasonably easily.  But, I digress.
>
> > > > i would have to agree with this assessment. The pi-calculus is a formal
> > > > device. Just like the lambda calculus, it's a stripped down, minimal
> > > > expression of some intuitions about computation (in pi's case, it's
> > > > computation as interaction). That said, in the same way that lambda
> > provides
> > > > excellent guidance -- a blueprint, if you will -- for the basic design
> > of
> > > > languages like, Lisp, Scheme, OCaml, F#, Haskell and Scala, one might
> > hope
> > > > that the pi-calculus could provide some guidance or a blueprint for a
> > new
> > > > family of languages that is better suited to computing in a highly
> > parallel,
> > > > highly distributed setting, such as the web applications powered up on
> > > > networks of racks and racks of multicore processors.
>
> > > > Some examples of languages following largely similar intuitions as
> > > > expressed in the pi-calculus include Erlang, Rosette and the actor
> > > > "sublanguage" of Scala. People have already given a pi-calculus
> > semantics to
> > > > "core" Erlang. My PhD work was driven by my desire to give a similar
> > account
> > > > of Rosette. It took forever for me to work out a reasonable account of
> > > > reflection -- which was a key feature of Rosette that i put to use in
> > > > commercial, mission-critical applications.
>
> > > > All that said, i would, and i think the whole community would also
> > benefit
> > > > from your experience and intuitions regarding what sort of language
> > features
> > > > have helped you and what didn't work out so well.
>
> > > I'm putting together a presentation for QCon that will trace Scala
> > language
> > > features to Lift features.  As with all my presentations, it will be
> > > available in the presentations directory athttp://
> > github.com/dpp/lift-samples/tree/master
>
> > > > Best wishes,
>
> > > > --greg
>
> > > > --
> > > > L.G. Meredith
> > > > Managing Partner
> > > > Biosimilarity LLC
> > > > 806 55th St NE
> > > > Seattle, WA 98105
>
> > > > +1 206.650.3740
>
> > > >http://bio

[Lift] Re: web logic

2009-01-24 Thread David Pollak
On Sat, Jan 24, 2009 at 6:25 AM, Marius  wrote:

>
> Whiew ... thank God the topic is split in two words  ...


Personal bias on my part (I was an early user of WebLogic's T3 [Tengah
[WebLogic]] and am friends with a bunch of the founders), but I believe that
WebLogic was an extremely important part of making Java and the JVM the
default for building and deploying server-side code in enterprise.

I haven't used WebLogic since 1998 (pre BEA acquisition), but at that time,
WebLogic was the best thing going for deploying server-side code.

Sorry for the rant... but... well... there's a very warm spot in my heart
for WebLogic.


>
>
> On Jan 23, 8:03 pm, David Pollak 
> wrote:
> > On Fri, Jan 23, 2009 at 9:29 AM, Meredith Gregory
> > wrote:
> >
> >
> >
> > > David,
> >
> > > i just noticed this paragraph.
> >
> > > Perhaps some sort of pi-calculus based way of describing web app logic
> > >> would allow for better reasoning.  I've noodled with doing some sort
> of
> > >> stuff with pi-calculus in Lift.  I stopped the exploration because I
> was
> > >> unable to find reasonable language constructs to express what I wanted
> > >> economically and in a way that a Rails or Struts or Wicket developer
> could
> > >> pick up reasonably easily.  But, I digress.
> >
> > > i would have to agree with this assessment. The pi-calculus is a formal
> > > device. Just like the lambda calculus, it's a stripped down, minimal
> > > expression of some intuitions about computation (in pi's case, it's
> > > computation as interaction). That said, in the same way that lambda
> provides
> > > excellent guidance -- a blueprint, if you will -- for the basic design
> of
> > > languages like, Lisp, Scheme, OCaml, F#, Haskell and Scala, one might
> hope
> > > that the pi-calculus could provide some guidance or a blueprint for a
> new
> > > family of languages that is better suited to computing in a highly
> parallel,
> > > highly distributed setting, such as the web applications powered up on
> > > networks of racks and racks of multicore processors.
> >
> > > Some examples of languages following largely similar intuitions as
> > > expressed in the pi-calculus include Erlang, Rosette and the actor
> > > "sublanguage" of Scala. People have already given a pi-calculus
> semantics to
> > > "core" Erlang. My PhD work was driven by my desire to give a similar
> account
> > > of Rosette. It took forever for me to work out a reasonable account of
> > > reflection -- which was a key feature of Rosette that i put to use in
> > > commercial, mission-critical applications.
> >
> > > All that said, i would, and i think the whole community would also
> benefit
> > > from your experience and intuitions regarding what sort of language
> features
> > > have helped you and what didn't work out so well.
> >
> > I'm putting together a presentation for QCon that will trace Scala
> language
> > features to Lift features.  As with all my presentations, it will be
> > available in the presentations directory athttp://
> github.com/dpp/lift-samples/tree/master
> >
> >
> >
> >
> >
> > > Best wishes,
> >
> > > --greg
> >
> > > --
> > > L.G. Meredith
> > > Managing Partner
> > > Biosimilarity LLC
> > > 806 55th St NE
> > > Seattle, WA 98105
> >
> > > +1 206.650.3740
> >
> > >http://biosimilarity.blogspot.com
> >
> > --
> > Lift, the simply functional web frameworkhttp://liftweb.net
> > Collaborative Task Managementhttp://much4.us
> > Follow me:http://twitter.com/dpp
> > Git some:http://github.com/dpp
> >
>


-- 
Lift, the simply functional web framework http://liftweb.net
Collaborative Task Management http://much4.us
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: web logic

2009-01-24 Thread Marius

Whiew ... thank God the topic is split in two words  ...

On Jan 23, 8:03 pm, David Pollak 
wrote:
> On Fri, Jan 23, 2009 at 9:29 AM, Meredith Gregory
> wrote:
>
>
>
> > David,
>
> > i just noticed this paragraph.
>
> > Perhaps some sort of pi-calculus based way of describing web app logic
> >> would allow for better reasoning.  I've noodled with doing some sort of
> >> stuff with pi-calculus in Lift.  I stopped the exploration because I was
> >> unable to find reasonable language constructs to express what I wanted
> >> economically and in a way that a Rails or Struts or Wicket developer could
> >> pick up reasonably easily.  But, I digress.
>
> > i would have to agree with this assessment. The pi-calculus is a formal
> > device. Just like the lambda calculus, it's a stripped down, minimal
> > expression of some intuitions about computation (in pi's case, it's
> > computation as interaction). That said, in the same way that lambda provides
> > excellent guidance -- a blueprint, if you will -- for the basic design of
> > languages like, Lisp, Scheme, OCaml, F#, Haskell and Scala, one might hope
> > that the pi-calculus could provide some guidance or a blueprint for a new
> > family of languages that is better suited to computing in a highly parallel,
> > highly distributed setting, such as the web applications powered up on
> > networks of racks and racks of multicore processors.
>
> > Some examples of languages following largely similar intuitions as
> > expressed in the pi-calculus include Erlang, Rosette and the actor
> > "sublanguage" of Scala. People have already given a pi-calculus semantics to
> > "core" Erlang. My PhD work was driven by my desire to give a similar account
> > of Rosette. It took forever for me to work out a reasonable account of
> > reflection -- which was a key feature of Rosette that i put to use in
> > commercial, mission-critical applications.
>
> > All that said, i would, and i think the whole community would also benefit
> > from your experience and intuitions regarding what sort of language features
> > have helped you and what didn't work out so well.
>
> I'm putting together a presentation for QCon that will trace Scala language
> features to Lift features.  As with all my presentations, it will be
> available in the presentations directory 
> athttp://github.com/dpp/lift-samples/tree/master
>
>
>
>
>
> > Best wishes,
>
> > --greg
>
> > --
> > L.G. Meredith
> > Managing Partner
> > Biosimilarity LLC
> > 806 55th St NE
> > Seattle, WA 98105
>
> > +1 206.650.3740
>
> >http://biosimilarity.blogspot.com
>
> --
> Lift, the simply functional web frameworkhttp://liftweb.net
> Collaborative Task Managementhttp://much4.us
> 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: Heartbeat

2009-01-24 Thread Marius

:)) .. you got the very "heart" of it :))

On Jan 22, 10:46 pm, Jorge Ortiz  wrote:
> Summary:
>
> DPP: I can haz heartbeat?
> Marius: Heartbeat? I dunno... that sounds ugly...
> DPP: It comes with GC too!
> Marius: Oh hellz yeah!
>
> --j
>
> On Thu, Jan 22, 2009 at 10:30 AM, Marius  wrote:
>
> > On Jan 22, 8:20 pm, David Pollak 
> > wrote:
> > > On Thu, Jan 22, 2009 at 9:35 AM, Marius  wrote:
>
> > > > On Jan 22, 7:17 pm, David Pollak 
> > > > wrote:
> > > > > On Thu, Jan 22, 2009 at 9:12 AM, Marius 
> > wrote:
>
> > > > > > Hmmm ... personally I'm not that thrilled about it. Can't we have
> > an
> > > > > > internal keep-alive mechanism that keeps the HTTP session not to
> > > > > > expire? ... I wonder if just getting the HttpSession reference
> > > > > > periodically and just don't do much with it would make the
> > container
> > > > > > to not expire the session.(Haven;t tried it though)
>
> > > > > > What if we do not rely on HTTP session at all? ... and use our own
> > > > > > session cookie&url rewriting? ... the downside would be risk for
> > the
> > > > > > users to store stuff directly on the HTTP session but I wonder if
> > > > > > anyone really does that in practice. LiftSession is most often
> > used.
>
> > > > > > The reason I'm not very excited about it is that browsers have
> > limited
> > > > > > parallel channels (2, 4, 8 etc.) shared between all tabs (AFAIK)
> > After
> > > > > > that AJax requests are queued.
>
> > > > > Yep.  Lift's comet stuff works around this limit.
>
> > > > > The heartbeat will be once every 30/60/90 seconds and it should be a
> > > > short
> > > > > message that will fit into 1 or 2 MTUs (packets) so the time to send
> > and
> > > > > service will be quick.
>
> > > > > The reason for the heartbeat is not simply to keep the session alive,
> > but
> > > > to
> > > > > keep sub-session data alive (what things on the page relate to
> > > > server-side
> > > > > state... functions bound to HTML elements).  Knowing what pages are
> > open
> > > > > with what HTML elements allows Lift to garbage collect unreferenced
> > > > > functions.
>
> > > >  ... but when you are saying "to garbage collect unreferenced
> > > > functions." do you mean the mapped functions?
>
> > > Yes.
>
> > > > Just asking cause I'm
> > > > not aware of a mechanism that actually cleans up mapped functions as
> > > > they are are cleared when session terminates.
>
> > > There is no mechanism, but there needs to be a mechanism before we call
> > Lift
> > > 1.0.  It's been on my list of over a year and I've explored different
> > > alternatives and reviewed what different frameworks do.  The best I can
> > come
> > > up with is a garbage collection scheme that works like the JVM's GC.  You
> > > have to know what's in the browser and you have to know what page the
> > > browser is on.  In Seaside, every URL has a sub-session token.  I really
> > > despise this approach because it makes URLs look ugly and if we did this,
> > > Charles (and others) would come after us with a meat ax or worse.
>
> > Oh for sure :) !
>
> > > We could
> > > re-write the URLs just before they're submitted, but it still doesn't
> > answer
> > > the question about page modification after a full page load.
>
> > > So, at the end of the day, I think Lift needs to have a constant
> > inventory
> > > of what's on the page and GC stuff that hasn't been seen on any page in
> > the
> > > last few minutes.  Thus, the heartbeat.
>
> > > > But maybe I'm missing
> > > > something here ...
>
> > > No... you're missing nothing.  I was brief and circumspec in my question
> > and
> > > you're drilling into the issue.  Drilling is good.
>
> > Now I'm good. Thank you Dave !
>
> > > Thanks,
>
> > > David
>
> > > > > > Br's,
> > > > > > Marius
>
> > > > > > On Jan 22, 1:52 am, David Pollak 
> > > > > > wrote:
> > > > > > > Folks,
>
> > > > > > > I've been working on some state related stuff in Lift.  It would
> > be
> > > > very
> > > > > > > helpful to have a heartbeat that goes from the browser to the
> > server
> > > > > > every
> > > > > > > 30 seconds or so.  If you've got a Comet component on the page,
> > the
> > > > > > > heartbeat will be part of the comet request.
>
> > > > > > > The benefits to this kind of mechanism includes never having an
> > idle
> > > > > > session
> > > > > > > time out.
>
> > > > > > > Any objections?
>
> > > > > > > Thanks,
>
> > > > > > > David
>
> > > > > > > --
> > > > > > > Lift, the simply functional web frameworkhttp://liftweb.net
> > > > > > > Collaborative Task Managementhttp://much4.us
> > > > > > > Follow me:http://twitter.com/dpp
> > > > > > > Git some:http://github.com/dpp
>
> > > > > --
> > > > > Lift, the simply functional web frameworkhttp://liftweb.net
> > > > > Collaborative Task Managementhttp://much4.us
> > > > > Follow me:http://twitter.com/dpp
> > > > > Git some:http://github.com/dpp
>
> > > --
> > > Lift, the simply functional web frameworkhttp://liftweb.net
> > > Collaborative Task Ma

[Lift] Re: Still confused about redirects

2009-01-24 Thread Tim Perrett

When you say all your pages are index.html, how do you mean? if your
file is index.html, in lift the URI would be /index right?


> Anyway, this helps a lot. So if I want to redirect thebook.html to
> /the_book/ I would do this:
>
> LiftRules.dispatch.prepend {
>    case r @ Req("thebook" :: Nil, "html", _) => () => Full(
>      PermRedirectResponse("/the_book", r))
>

Correct :-)



--~--~-~--~~~---~--~~
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: Still confused about redirects

2009-01-24 Thread Charles F. Munat

Yeah, except I'm concerned that if I do this, I'll end up with loops (or 
at least requests for index.html will be redirected). All my pages are 
index.html, and all the pages I need to redirect from are not. So I 
intended to do a regex that grabbed everything that ended in html but 
was not index.html (except that I'm having a hell of a time writing that 
regex, so I'm just doing a list of pages to redirect).

Anyway, this helps a lot. So if I want to redirect thebook.html to 
/the_book/ I would do this:

LiftRules.dispatch.prepend {
   case r @ Req("thebook" :: Nil, "html", _) => () => Full(
 PermRedirectResponse("/the_book", r))
}

Right?

Chas.

Tim Perrett wrote:
> Chas,
> 
> As it happens, I need to do this also. For me, im porting a rails app,
> so dont have the .html issues and im doing case by case redirects. So,
> I have something like:
> 
> LiftRules.dispatch.prepend {
>   case r @ Req("about" :: Nil, "", _) => () => Full
> (PermRedirectResponse("/about-us",r))
> }
> 
> However, if you want to redirect all your html pages back to the
> index, you'd need something like:
> 
> LiftRules.dispatch.prepend {
>   case r @ Req(page, "html", _) => () => Full(PermRedirectResponse
> ("/",r))
> }
> 
> Does that make sense?
> 
> Cheers, Tim
> 
> On Jan 24, 3:30 am, "Charles F. Munat"  wrote:
>> Thanks! That helps. I'll try to figure it out.
>>
>> Chas.
>>
>> Marius wrote:
>>> LiftRules.prepend.dispatch is the right way.
>>> You pattern-match for *.html and return a PermRedirectResponse.
>>> Br's,
>>> Marius
>>> On Jan 23, 3:05 am, "Charles F. Munat"  wrote:
 I'm trying to do something dead simple, so it's impossible, of course.
 I have some legacy pages that don't exist anymore, and I want to send
 permanent (301) redirects to the browser. For example:
 Redirect permanent /thebook.htmlhttp://mysite.com/the_book/
 The above should work in my vhosts.d conf file, but, of course, it
 doesn't. Have tried it 50 ways.
 Searched for information about how to do redirects in Jetty: no joy.
 David gave me a hint some time ago using LiftRules.prepend.dispatch, but
 I'm too stupid to understand it.
 What I *really* want is for any request to any *.html page NOT
 index.html to go to the home page. Or, I'd be happy to just provide a
 list of from and to paths and have some code that does the redirects.
 This seems like a useful feature since my Lift sites will often replace
 legacy sites and it would be nice to be able to set up a list of old
 page -> new page and just have the redirects go out (maybe with the
 option of permanent or temporary).
 Anyone know how to do this that can explain it in kindergarten terms? My
 brain is really fried today.
 Thanks!
 Chas.
> > 

--~--~-~--~~~---~--~~
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: Still confused about redirects

2009-01-24 Thread Tim Perrett

Chas,

As it happens, I need to do this also. For me, im porting a rails app,
so dont have the .html issues and im doing case by case redirects. So,
I have something like:

LiftRules.dispatch.prepend {
  case r @ Req("about" :: Nil, "", _) => () => Full
(PermRedirectResponse("/about-us",r))
}

However, if you want to redirect all your html pages back to the
index, you'd need something like:

LiftRules.dispatch.prepend {
  case r @ Req(page, "html", _) => () => Full(PermRedirectResponse
("/",r))
}

Does that make sense?

Cheers, Tim

On Jan 24, 3:30 am, "Charles F. Munat"  wrote:
> Thanks! That helps. I'll try to figure it out.
>
> Chas.
>
> Marius wrote:
> > LiftRules.prepend.dispatch is the right way.
>
> > You pattern-match for *.html and return a PermRedirectResponse.
>
> > Br's,
> > Marius
>
> > On Jan 23, 3:05 am, "Charles F. Munat"  wrote:
> >> I'm trying to do something dead simple, so it's impossible, of course.
>
> >> I have some legacy pages that don't exist anymore, and I want to send
> >> permanent (301) redirects to the browser. For example:
>
> >> Redirect permanent /thebook.htmlhttp://mysite.com/the_book/
>
> >> The above should work in my vhosts.d conf file, but, of course, it
> >> doesn't. Have tried it 50 ways.
>
> >> Searched for information about how to do redirects in Jetty: no joy.
>
> >> David gave me a hint some time ago using LiftRules.prepend.dispatch, but
> >> I'm too stupid to understand it.
>
> >> What I *really* want is for any request to any *.html page NOT
> >> index.html to go to the home page. Or, I'd be happy to just provide a
> >> list of from and to paths and have some code that does the redirects.
> >> This seems like a useful feature since my Lift sites will often replace
> >> legacy sites and it would be nice to be able to set up a list of old
> >> page -> new page and just have the redirects go out (maybe with the
> >> option of permanent or temporary).
>
> >> Anyone know how to do this that can explain it in kindergarten terms? My
> >> brain is really fried today.
>
> >> Thanks!
> >> Chas.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---