[Lift] Re: Lift deal breakers
Hey, If I understand Dustin correctly here he wants unobtrusive javascript. That is no javascript in the elements but javascript code that hooks into the dom and attaches events as needed. I am not familiar enough with the internals of lift's js wrapping to know how easy it would be to do it this way. regards Bjarte On Sat, Sep 12, 2009 at 5:30 AM, DMB combust...@gmail.com wrote: I'm not sure how you'd implement an _ajax_ Button without Javascript. :-) I also don't see how it is bad for SEO. These days, depending on the page and search engine, Javascript either gets executed (if there are JS blocks that run onload or inline) or ignored. In case of less popular pages, JS is nearly always ignored, for indexing performance reasons. On Sep 11, 7:13 pm, Dustin Whitney dustin.whit...@gmail.com wrote: Hey, I like Lift so in an effort to improve it I am submitting some criticism. Obtrusive javascript: when I create an ajaxButton I get this html: button onclick=liftAjax.lift_ajaxHandler(quot;F1029758482780OTA=truequot;, null, null, null); return false;Press me/button That onclick is not ok. It's bad for SEO and makes the page harder to read. Ideally, no javascript should appear on the page whatsoever. Client Side Load Time: I strive for that A in Y-Slow, so when I see script type=text/javascript src=/ajax_request/liftAjax.js view-source:http://localhost:8080/ajax_request/liftAjax.js/script at the top of the page, I feel a little uneasy, and there is nothing I can do (I think) to move it to the bottom of the page. -Dustin -- Bjarte Stien Karlsen Ronatoppen 6a, 4638 Kristiansand 95219547 MSN: m...@ibjarte.com --~--~-~--~~~---~--~~ 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] email encoding problem
hi all, I'm new to lift, I met with a problem when trying to send a mail. //Mail.scala--- package my.site import net.liftweb.util._ import Helpers._ import Mailer._ import javax.mail._ import javax.mail.internet._ import xml._ object Mail { var from = def config(host: String, user: String, password: String) { System.setProperty(mail.smtp.starttls.enable,true); System.setProperty(mail.smtp.host, host) System.setProperty(mail.smtp.auth, true) System.setProperty(mail.mime.charset, UTF-8) Mailer.authenticator = Full(new Authenticator { override def getPasswordAuthentication = new PasswordAuthentication(user, password) }) from = user } def send(to: String, xmlContent: NodeSeq) { sendMail(From(from), Subject(hi), XHTMLMailBodyType(xmlContent)::To(to)::Nil : _* ) } } //useMail.scala-- ... // host, user, password my.site.Mail.config(smtp.gmail.com, *...@gmail.com, *) // the recieved mail body becomes p??/p my.site.Mail.send(*...@gmail.com, (p你好/p)) All source files are UTF-8, and project.build.sourceEncoding is UTF-8 too. Is there a missing step? --~--~-~--~~~---~--~~ 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: Lift deal breakers
I am not a fan of buttons in the html that don't do anything if javascript is disabled. To stop them from coming up in a text based browser or something similar, I've always had the rule for myself that any forms or buttons dependent on javascript must be inserted by javascript, and everything that appears in a plain html page should be functional (to some degree) with no javascript. That is the definition of unobtrusive javascript that I learned. I haven't yet spent much time with letting lift handle my javascript as I am used to handling it myself so I'm not too familiar yet with the limitations when making unobtrusive javascript solely with lift. I have always designed my pages first with no javascript, make it all work, and then add javascript/ajax without breaking the original behavior (overriding of course, using ajax instead of following a link, that sort of thing). -- Derek Williams --~--~-~--~~~---~--~~ 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: MappedDate.setFromAny only works with strings?
Also, the LiftRules.parseDate function currently does DateTime parsing, so I would have to make a breaking change to rename it to parseDateTime and add new parseDate and parseTime (and associated format methods). Thoughts? I think this is the right solution. Don't know how much will break because of this though. But hey, if we're breaking things anyway, why not put in Joda time (or maybe scala-timehttp://github.com/jorgeortiz85/scala-time/tree/master;-) Although not belonging to breaking changers camp, breaking changes are great when it's for a cause. IMHO, scala time is a darn good cause and worth the break! Cheers, Indrajit /Jeppe --~--~-~--~~~---~--~~ 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: Lift deal breakers
On Sep 12, 8:34 am, Indrajit Raychaudhuri indraj...@gmail.com wrote: Even if we assumed that Lift managed to do all the hard work, we still have a contradictory situation: the body/ being completely devoid of scripts but still have 'JS loaded at the end of the page'. It still has to be before the close of body tag and thereby sneaking into the body/. Worse, it's going to be incredibly difficult to implement a rich client interface (Cappuccino, Dojo, Sproutcore etc. - those who want to take complete control over the DOM) without the developer constantly having to prevent Lift and the UI framework not wrestle and step into the each other. A web *application* (like CMS) can get away with that, but not a *framework* (like Lift). What control of Lift over the DOM are you talking about. Lift's generated scripts in HTML is minimal, and it is about Comet mostly. Lift scripts do not really stay in other frameworks way. If you have a concrete example where Lift's stays in the way of integrating other tools please be specific about the problem and we'll see what/if we can do something about it. What is the exact wrestle here? And I am given to understand spiders are nowadays smart to recognize dom events handlers (e.g., onclick) and decide what to do when it encounters them. Oh, and while at that, 'view source' a GWT based application and help youself have a perspective :) Cheers, Indrajit On Sep 12, 5:07 pm, marius d. marius.dan...@gmail.com wrote: +1 Andrew. Regarding the rule - absolutely no javascript in the markup doesn't make a lot of sense. Some of the Lift's generated javascript for comet/ ajax calls is put inline at the end of the page. I see no practical reason not to do that. On the other hand putting liftAjax.js on the top of the page is not bad either. IN certain situations users may need this loaded prior their own js code. Besides I really doubt that putting it at the end of the page would really make any practical difference. Not putting lift's JS callas such as Ajax at onclick events like that can become quite lucrative from framework perspective because: 1. Lift would have to queue all these events and add them to a JS sequence and add this js to the served page. 2. that would create a dependency to JQuery events style that would have to be changed when YUI is in place or potentially other framework. If we'd still want this style but be JS library agnostic we'd have to do our own DOM manipulation etc which just adds more overhead without any practical gain. Br's, Marius On Sep 11, 10:18 pm, Andrew Scherpbier and...@scherpbier.org wrote: Dustin Whitney wrote:Hey, I like Lift so in an effort to improve it I am submitting some criticism. Obtrusive javascript: when I create an ajaxButton I get this html:buttononclick=liftAjax.lift_ajaxHandler(quot;F1029758482780OTA=truequot;, null, null, null); return false;Press me/buttonThat onclick is not ok. It's bad for SEO and makes the page harder to read. Ideally, no javascript should appear on the page whatsoever. (I presume here SEO == Search Engine Optimization.) If you are going to use AJAX in your website, you have to use Javascript, right? If you don't want to use AJAX with lift, don't... Just use standard forms and links. (Also turn off client-side garbage collection and any comet stuff in Boot.scala...) So assuming you actually want an ajaxButton, the onclick needs to get in there somehow. The only other way would be to have lift create some javascript that modifies the DOM to somehow add that onclick. I think that would be much harder to read! For the SEO stuff, are you assuming deep traversal (clicking through forms) into your webapp by spiders? I don't know of any spiders that do that very well. Anyway, if that's what you want, then I wouldn't use AJAX for anything. A neat trick to let spiders get to all your public pages if your site has a complex form/ajax based navigation system is to use a site map and make sure all your main URLS are simple, non-form URLs. Criticism is best if one can demonstrate a better alternative.Client Side Load Time: I strive for that A in Y-Slow, so when I seescripttype=text/javascriptsrc=/ajax_request/liftAjax.js/scriptat the top of the page, I feel a little uneasy, and there is nothing I can do (I think) to move it to the bottom of the page. Have you actually verified that this makes a difference? I haven't verified this, so pardon my ignorance. It just seems like it either makes a difference of milliseconds or no difference at all because modern browsers make parallel requests and start rendering before everything is available. I'm sure if you can demonstrate two pages where the only difference is the location of the script include, and the one with the script include up front is noticeably slower
[Lift] Re: testing
OK, I've got the lift-archetype-basic working now just as the post shows. In pursuit of BDD, I want to test some behavior this way: 1. Set up a 'test' database with a single SuperUser using fields I know work with password, salt, etc. 2. Sign In as that SuperUser. 3. Sign Up another SuperUser with fields I supply, and send the verification email. 4. Tear down everything after the tests run, leaving no database. That's the beginning of the sort of testing I want to use to build my next app. Perhaps it's all there already, but it's not obvious to me yet. On Sep 9, 5:35 pm, David Pollak feeder.of.the.be...@gmail.com wrote: Dustin, I've updated the Basic archetype to include a couple of things: - An example of Lift's new Factory support which blends the best of dependency injection and and highly configurable, type-safe factories - An example of how to set up a session to test a snippet - An example of injecting a test value into the snippet test via the factory The test that you asked about looks like: object HelloWorldTestSpecs extends Specification { val session = new LiftSession(, randomString(20), Empty) HelloWorld Snippet should { Put the time in the node in { S.initIfUninitted(session) { val stableTime = now DependencyFactory.time.doWith(stableTime) { val hello = new HelloWorld Thread.sleep(1000) // make sure the time changes val str = hello.howdy(spanHello at b:time//span).toString str.indexOf(stableTime.toString) must be = 0 str.indexOf(Hello at) must be = 0 } } } } } This demonstrates creating a mock LiftSession and setting up S with initIfUnitted. The DepencyFactory.time.doWith sets up a new value to be generated from the DepencyFactory.time object (rather than using the global default function, the stableTime value is used.) In the HelloWord snippet, we inject the value of the time object: class HelloWorld { import DependencyFactory._ // Import the Dependency Injector val date = inject[Date] // inject the date // lazy val date = DependencyFactory.time.make // create the date via factory def howdy(in: NodeSeq): NodeSeq = Helpers.bind(b, in, time - date.map(d = Text(d.toString))) } Note there are two ways of getting the time. The inject method will locate a Maker for a java.util.Date. This is a whole lot less (in my opinion) optimal than the second option, which explicitly calls the time factory. In either case, the current time Maker (global, session-specific, request-specific, and stack-specific) is consulted. To build the Factory itself: object DependencyFactory extends Factory { implicit object time extends FactoryMaker(Helpers.now _) } I hope this answers you question about testing snippets and more broadly addresses some of the recent discussions on the list about Dependency Injection, Factories, mocks, and testing. Thanks, David On Wed, Sep 9, 2009 at 1:05 PM, Dustin Whitney dustin.whit...@gmail.comwrote: All, I am having trouble finding any literature on how to test a Lift app. I've got a snippet. I'd like to mock a request and test the NodeSeq that comes back from the render method in my snippet. Can anyone point me to some code that's doing that? Thanks, Dustin -- 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: email encoding problem
the last part is like: Subject: hi MIME-Version: 1.0 Content-Type: multipart/alternative; boundary==_Part_0_21171036.1252770284921 --=_Part_0_21171036.1252770284921 Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit p??/p --=_Part_0_21171036.1252770284921-- I don't know how to set Content-Type ... On Sep 12, 10:34 pm, Indrajit Raychaudhuri indraj...@gmail.com wrote: Can you please check what the Content-Type field in the mail header looks like in the mail that you get? Cheers, Indrajit --~--~-~--~~~---~--~~ 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: email encoding problem
Content-Type: text/html; charset=us-ascii IMHO that should read: Content-Type: text/html; charset=UTF-8 So basically, the content-type isn't correctly set. On Sat, Sep 12, 2009 at 5:55 PM, night_stalker usur...@gmail.com wrote: the last part is like: Subject: hi MIME-Version: 1.0 Content-Type: multipart/alternative; boundary==_Part_0_21171036.1252770284921 --=_Part_0_21171036.1252770284921 Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit p??/p --=_Part_0_21171036.1252770284921-- I don't know how to set Content-Type ... On Sep 12, 10:34 pm, Indrajit Raychaudhuri indraj...@gmail.com wrote: Can you please check what the Content-Type field in the mail header looks like in the mail that you get? Cheers, Indrajit -- Viktor Klang Blog: klangism.blogspot.com Twttr: viktorklang Lift Committer - liftweb.com AKKA Committer - akkasource.org Cassidy - github.com/viktorklang/Cassidy.git SoftPub founder: http://groups.google.com/group/softpub --~--~-~--~~~---~--~~ 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: email encoding problem
Indeed, but Content-Transfer-Encoding: 7bit could be the real suspect. I think, MimeBodyPart forces us-ascii charset for 7bit encoding. Cheers, Indrajit On Sep 12, 9:03 pm, Viktor Klang viktor.kl...@gmail.com wrote: Content-Type: text/html; charset=us-ascii IMHO that should read: Content-Type: text/html; charset=UTF-8 So basically, the content-type isn't correctly set. On Sat, Sep 12, 2009 at 5:55 PM, night_stalker usur...@gmail.com wrote: the last part is like: Subject: hi MIME-Version: 1.0 Content-Type: multipart/alternative; boundary==_Part_0_21171036.1252770284921 --=_Part_0_21171036.1252770284921 Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit p??/p --=_Part_0_21171036.1252770284921-- I don't know how to set Content-Type ... On Sep 12, 10:34 pm, Indrajit Raychaudhuri indraj...@gmail.com wrote: Can you please check what the Content-Type field in the mail header looks like in the mail that you get? Cheers, Indrajit -- Viktor Klang Blog: klangism.blogspot.com Twttr: viktorklang Lift Committer - liftweb.com AKKA Committer - akkasource.org Cassidy - github.com/viktorklang/Cassidy.git SoftPub founder:http://groups.google.com/group/softpub --~--~-~--~~~---~--~~ 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: email encoding problem
Thank you all for your replies. I just modified net/liftweb/util/Mailer.scala, replaced all text/html with text/html;charset=UTF-8 , then problem solved. the result mail's Content-Type part becomes: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable and 你好 is shown correctly. --~--~-~--~~~---~--~~ 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: email encoding problem
Good catch! On Sep 12, 2009 6:18 PM, Indrajit Raychaudhuri indraj...@gmail.com wrote: Indeed, but Content-Transfer-Encoding: 7bit could be the real suspect. I think, MimeBodyPart forces us-ascii charset for 7bit encoding. Cheers, Indrajit On Sep 12, 9:03 pm, Viktor Klang viktor.kl...@gmail.com wrote: Content-Type: text/html; charset... On Sat, Sep 12, 2009 at 5:55 PM, night_stalker usur...@gmail.com wrote: the last part is l... Viktor Klang Blog: klangism.blogspot.com Twttr: viktorklang Lift Committer - liftweb.com... --~--~-~--~~~---~--~~ You received this message because you are subs... --~--~-~--~~~---~--~~ 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] setting cookies in an ajax response
I have an SHtml.ajaxSelect that, when executed sets a cookie: S.addCookie(HTTPCookie(CITYID, city.id.toString)) and then returns a JsCmds.RedirectTo(uri) command. The cookie isn't actually being set (if I look at the live http headers the Set-Cookie line isn't sent down in the http response to the ajax call. It's not clear to me if this is correct behavior on lift's part, of if this is a bug. If it is correct behavior, is there a better way to do this sort of thing? -harryh --~--~-~--~~~---~--~~ 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: Lift deal breakers
I, too, would like to be able to move the liftAjax script call to the bottom of the page. Chas. Dustin Whitney wrote: Hey, I like Lift so in an effort to improve it I am submitting some criticism. Obtrusive javascript: when I create an ajaxButton I get this html: button onclick=liftAjax.lift_ajaxHandler(quot;F1029758482780OTA=truequot;, null, null, null); return false;Press me/button That onclick is not ok. It's bad for SEO and makes the page harder to read. Ideally, no javascript should appear on the page whatsoever. Client Side Load Time: I strive for that A in Y-Slow, so when I see script type=text/javascript src=/ajax_request/liftAjax.js view-source:http://localhost:8080/ajax_request/liftAjax.js/script at the top of the page, I feel a little uneasy, and there is nothing I can do (I think) to move it to the bottom of the page. -Dustin --~--~-~--~~~---~--~~ 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: MappedDate.setFromAny only works with strings?
+1 for joda or scala time if it's not too disruptive Chas. Indrajit Raychaudhuri wrote: Also, the LiftRules.parseDate function currently does DateTime parsing, so I would have to make a breaking change to rename it to parseDateTime and add new parseDate and parseTime (and associated format methods). Thoughts? I think this is the right solution. Don't know how much will break because of this though. But hey, if we're breaking things anyway, why not put in Joda time (or maybe scala-timehttp://github.com/jorgeortiz85/scala-time/tree/master;-) Although not belonging to breaking changers camp, breaking changes are great when it's for a cause. IMHO, scala time is a darn good cause and worth the break! Cheers, Indrajit /Jeppe --~--~-~--~~~---~--~~ 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: Lift deal breakers
One nice thing about jquery's events, if done wisely, is they are applied after the DOM is loaded. With an onclick a button can be clicked and some ajax call is fired that returns and tries to modify a part of the DOM that hasn't been loaded. This is especially true if you have lots of javascript includes at the top of the page. I have waded my way through many wonky javascript bugs like this. They don't happen in your local environment because they load so quickly, but when pushed to production, problems ensue. Maybe there is a hook in the lift ajax js that waits to fire the call until after the DOM is loaded? -D On Sat, Sep 12, 2009 at 2:48 PM, Charles F. Munat c...@munat.com wrote: I, too, would like to be able to move the liftAjax script call to the bottom of the page. Chas. Dustin Whitney wrote: Hey, I like Lift so in an effort to improve it I am submitting some criticism. Obtrusive javascript: when I create an ajaxButton I get this html: button onclick=liftAjax.lift_ajaxHandler(quot;F1029758482780OTA=truequot;, null, null, null); return false;Press me/button That onclick is not ok. It's bad for SEO and makes the page harder to read. Ideally, no javascript should appear on the page whatsoever. Client Side Load Time: I strive for that A in Y-Slow, so when I see script type=text/javascript src=/ajax_request/liftAjax.js view-source:http://localhost:8080/ajax_request/liftAjax.js/script at the top of the page, I feel a little uneasy, and there is nothing I can do (I think) to move it to the bottom of the page. -Dustin --~--~-~--~~~---~--~~ 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: Lift deal breakers
Moving the script import shouldn't be too difficult, we have the lift:tail element and tail merge (which acts exactly the same as head merge) for just this sort of problem. On Sat, Sep 12, 2009 at 8:07 PM, Dustin Whitney dustin.whit...@gmail.comwrote: One nice thing about jquery's events, if done wisely, is they are applied after the DOM is loaded. With an onclick a button can be clicked and some ajax call is fired that returns and tries to modify a part of the DOM that hasn't been loaded. This is especially true if you have lots of javascript includes at the top of the page. I have waded my way through many wonky javascript bugs like this. They don't happen in your local environment because they load so quickly, but when pushed to production, problems ensue. Maybe there is a hook in the lift ajax js that waits to fire the call until after the DOM is loaded? -D On Sat, Sep 12, 2009 at 2:48 PM, Charles F. Munat c...@munat.com wrote: I, too, would like to be able to move the liftAjax script call to the bottom of the page. Chas. Dustin Whitney wrote: Hey, I like Lift so in an effort to improve it I am submitting some criticism. Obtrusive javascript: when I create an ajaxButton I get this html: button onclick=liftAjax.lift_ajaxHandler(quot;F1029758482780OTA=truequot;, null, null, null); return false;Press me/button That onclick is not ok. It's bad for SEO and makes the page harder to read. Ideally, no javascript should appear on the page whatsoever. Client Side Load Time: I strive for that A in Y-Slow, so when I see script type=text/javascript src=/ajax_request/liftAjax.js view-source:http://localhost:8080/ajax_request/liftAjax.js/script at the top of the page, I feel a little uneasy, and there is nothing I can do (I think) to move it to the bottom of the page. -Dustin --~--~-~--~~~---~--~~ 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] how / where to set the runmode of a lift application?
can anyone tell me how I can change the runmode of my application to production? thanks --~--~-~--~~~---~--~~ 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: setting cookies in an ajax response
If it doesn't send down the cookie as you did, it sounds like a bug. I'd fix it but I can't in the next couple of weeks. Br's, Marius On Sep 12, 12:54 pm, harryh har...@gmail.com wrote: I have an SHtml.ajaxSelect that, when executed sets a cookie: S.addCookie(HTTPCookie(CITYID, city.id.toString)) and then returns a JsCmds.RedirectTo(uri) command. The cookie isn't actually being set (if I look at the live http headers the Set-Cookie line isn't sent down in the http response to the ajax call. It's not clear to me if this is correct behavior on lift's part, of if this is a bug. If it is correct behavior, is there a better way to do this sort of thing? -harryh --~--~-~--~~~---~--~~ 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 / where to set the runmode of a lift application?
One way is it to use the run.mode parameter and start your webapp using this command: mvn jetty:run -Drun.mode=production I believe you can also modify web.xml in some way, but I'm not really sure. -Xavi On Sat, Sep 12, 2009 at 5:00 PM, george geo...@mattandgeorge.com wrote: can anyone tell me how I can change the runmode of my application to production? thanks --~--~-~--~~~---~--~~ 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: Lift deal breakers
Maybe adding javascript event handlers could be delegated to something that depends on which library is being used? - Kevin Wrightkev.lee.wri...@googlemail.com wrote: Moving the script import shouldn't be too difficult, we have the lift:tail element and tail merge (which acts exactly the same as head merge) for just this sort of problem. On Sat, Sep 12, 2009 at 8:07 PM, Dustin Whitney dustin.whit...@gmail.comwrote: One nice thing about jquery's events, if done wisely, is they are applied after the DOM is loaded. With an onclick a button can be clicked and some ajax call is fired that returns and tries to modify a part of the DOM that hasn't been loaded. This is especially true if you have lots of javascript includes at the top of the page. I have waded my way through many wonky javascript bugs like this. They don't happen in your local environment because they load so quickly, but when pushed to production, problems ensue. Maybe there is a hook in the lift ajax js that waits to fire the call until after the DOM is loaded? -D On Sat, Sep 12, 2009 at 2:48 PM, Charles F. Munat c...@munat.com wrote: I, too, would like to be able to move the liftAjax script call to the bottom of the page. Chas. Dustin Whitney wrote: Hey, I like Lift so in an effort to improve it I am submitting some criticism. Obtrusive javascript: when I create an ajaxButton I get this html: button onclick=liftAjax.lift_ajaxHandler(quot;F1029758482780OTA=truequot;, null, null, null); return false;Press me/button That onclick is not ok. It's bad for SEO and makes the page harder to read. Ideally, no javascript should appear on the page whatsoever. Client Side Load Time: I strive for that A in Y-Slow, so when I see script type=text/javascript src=/ajax_request/liftAjax.js view-source:http://localhost:8080/ajax_request/liftAjax.js/script at the top of the page, I feel a little uneasy, and there is nothing I can do (I think) to move it to the bottom of the page. -Dustin --~--~-~--~~~---~--~~ 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] Checksum problems still?
I created a blank JPA lift project using this: mvn archetype:generate \ -DarchetypeRepository=http://scala-tools.org/repo-snapshots \ -DarchetypeGroupId=net.liftweb \ -DarchetypeArtifactId=lift-archetype-jpa-basic \ -DarchetypeVersion=1.1-SNAPSHOT \ -DgroupId=com.foo.jpaweb \ -DartifactId=JPADemo \ -Dversion=1.0-SNAPSHOT And once again I got this, though the blank project did build: [INFO] snapshot net.liftweb:lift-archetype-jpa-blank:1.1-SNAPSHOT: checking for updates from lift-archetype-jpa-blank-repo Downloading: http://scala-tools.org/repo-snapshots/net/liftweb/lift-archetype-jpa-blank/1.1-SNAPSHOT/lift-archetype-jpa-blank-1.1-SNAPSHOT.jar 10K downloaded [WARNING] *** CHECKSUM FAILED - Checksum failed on download: local = '5e23929733fdf6c781eb949ad5865ab6f83c17a3'; remote = '85587ccfa9b398f60f08163f9bb55610d6fb3f72' - RETRYING Downloading: http://scala-tools.org/repo-snapshots/net/liftweb/lift-archetype-jpa-blank/1.1-SNAPSHOT/lift-archetype-jpa-blank-1.1-SNAPSHOT.jar 10K downloaded [WARNING] *** CHECKSUM FAILED - Checksum failed on download: local = '5e23929733fdf6c781eb949ad5865ab6f83c17a3'; remote = '85587ccfa9b398f60f08163f9bb55610d6fb3f72' - IGNORING ??? Thought this got fixed. 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: Lift deal breakers
Technically it could (as I implied above) but this can be lucrative and IMHO the benefits are simply not that big. I'm not saying that things are nailed down but I'd love to see a list of practical benefits for Lift to not add event handlers such as on click to the elements but rather programatically using synthetic (lift generated) JS functions that would add events (i.e. JQuery, YUI ways). Br's, Marius On Sep 12, 9:05 pm, Naftoli Gugenheim naftoli...@gmail.com wrote: Maybe adding javascript event handlers could be delegated to something that depends on which library is being used? - Kevin Wrightkev.lee.wri...@googlemail.com wrote: Moving the script import shouldn't be too difficult, we have the lift:tail element and tail merge (which acts exactly the same as head merge) for just this sort of problem. On Sat, Sep 12, 2009 at 8:07 PM, Dustin Whitney dustin.whit...@gmail.comwrote: One nice thing about jquery's events, if done wisely, is they are applied after the DOM is loaded. With an onclick a button can be clicked and some ajax call is fired that returns and tries to modify a part of the DOM that hasn't been loaded. This is especially true if you have lots of javascript includes at the top of the page. I have waded my way through many wonky javascript bugs like this. They don't happen in your local environment because they load so quickly, but when pushed to production, problems ensue. Maybe there is a hook in the lift ajax js that waits to fire the call until after the DOM is loaded? -D On Sat, Sep 12, 2009 at 2:48 PM, Charles F. Munat c...@munat.com wrote: I, too, would like to be able to move the liftAjax script call to the bottom of the page. Chas. Dustin Whitney wrote: Hey, I like Lift so in an effort to improve it I am submitting some criticism. Obtrusive javascript: when I create an ajaxButton I get this html: button onclick=liftAjax.lift_ajaxHandler(quot;F1029758482780OTA=truequot;, null, null, null); return false;Press me/button That onclick is not ok. It's bad for SEO and makes the page harder to read. Ideally, no javascript should appear on the page whatsoever. Client Side Load Time: I strive for that A in Y-Slow, so when I see script type=text/javascript src=/ajax_request/liftAjax.js view-source:http://localhost:8080/ajax_request/liftAjax.js/script at the top of the page, I feel a little uneasy, and there is nothing I can do (I think) to move it to the bottom of the page. -Dustin --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---