[Lift] Re: The LiftView trait can't work ?
On Wed, Sep 23, 2009 at 7:29 PM, Neil.Lv anim...@gmail.com wrote: It works now that i add /test/hello into the SiteMap. Menu(Loc(Test, List(test, hello), Test)) But i have something questions about the SiteMap. If i have more and more these links in my application whether i must add these links one by one into the SiteMap ? Yes. You may choose to use sitemap or not use it. If you choose not to use it, comment out the LiftRules.setSiteMap(SiteMap(MenuInfo.menu :_*)) line What you get from sitemap: - Automatic context-sensitive navigation - Page-level access control - Inaccessible links are never displayed So, if you're just knocking around with Lift, disable sitemap if it's getting in your way. If you're building an app where having a correct menu displayed and having a unified security model is important, SiteMap is your friend. Such as: Menu(Loc(Test, List(test, hello), Test)) :: Menu(...) :: Menu(...) :: Menu(...) ... Maybe this code will be very long whether there is another way to achieve this goal. Cheers, Neil On Sep 24, 9:39 am, Neil.Lv anim...@gmail.com wrote: Yeah, i use the Lift 1.0. I just want to test the LiftView trait, when i don't configure the viewDispatch in Boot Class and don't define the corresponding template (such as /Test/hello.html in webapp directory), then i type the http://localhost:8080/Test/hello; link that the View Class can to do it. Thank you for your reply that it's very helpful. I'll try to add /Test/hello in the SiteMap and test it again. Cheers, Neil On Sep 23, 11:19 pm, David Pollak feeder.of.the.be...@gmail.com wrote: If you're using Lift 1.0.x, the request will silently fail. If you're using Lift 1.1-x, you will get a helpful error message reminding you to add the /Test/hello link to your SiteMap in Boot.scala On Wed, Sep 23, 2009 at 1:02 AM, Neil.Lv anim...@gmail.com wrote: Hi all, Just I define a class that extends the LiftView trait, but there is something wrong with this class when i using it. I wrote some test code like this: ### code ### package com.test.view import net.liftweb._ import http._ import scala.xml.{NodeSeq} class Test extends LiftView { override def dispatch = { case hello = doTest _ } def doTest():NodeSeq = { lift:surround with=default at=content Time is: {new _root_.java.util.Date} /lift:surround } } ### code ### Use these links and always get this message The Requested URL / Test/hello was not found on this server http://localhost:8080/Test/hello http://localhost:8080/test/hello Note: I don't change my Boot class in the /src/main/scala/ bootstrap/liftweb folder. Is there anyone can help ? Thanks very much! -- Lift, the simply functional web frameworkhttp://liftweb.net Beginning Scalahttp://www.apress.com/book/view/1430219890 Follow me:http://twitter.com/dpp Surf the harmonics -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Surf the harmonics --~--~-~--~~~---~--~~ 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: The LiftView trait can't work ?
If you haven't changed boot, then you'll find that they are not wired up if memory serves... What are you trying to achieve exactly? Cheers, Tim On Sep 23, 9:02 am, Neil.Lv anim...@gmail.com wrote: Hi all, Just I define a class that extends the LiftView trait, but there is something wrong with this class when i using it. I wrote some test code like this: ### code ### package com.test.view import net.liftweb._ import http._ import scala.xml.{NodeSeq} class Test extends LiftView { override def dispatch = { case hello = doTest _ } def doTest():NodeSeq = { lift:surround with=default at=content Time is: {new _root_.java.util.Date} /lift:surround }} ### code ### Use these links and always get this message The Requested URL / Test/hello was not found on this server http://localhost:8080/Test/hello http://localhost:8080/test/hello Note: I don't change my Boot class in the /src/main/scala/ bootstrap/liftweb folder. Is there anyone can help ? Thanks very much! --~--~-~--~~~---~--~~ 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: The LiftView trait can't work ?
If you're using Lift 1.0.x, the request will silently fail. If you're using Lift 1.1-x, you will get a helpful error message reminding you to add the /Test/hello link to your SiteMap in Boot.scala On Wed, Sep 23, 2009 at 1:02 AM, Neil.Lv anim...@gmail.com wrote: Hi all, Just I define a class that extends the LiftView trait, but there is something wrong with this class when i using it. I wrote some test code like this: ### code ### package com.test.view import net.liftweb._ import http._ import scala.xml.{NodeSeq} class Test extends LiftView { override def dispatch = { case hello = doTest _ } def doTest():NodeSeq = { lift:surround with=default at=content Time is: {new _root_.java.util.Date} /lift:surround } } ### code ### Use these links and always get this message The Requested URL / Test/hello was not found on this server http://localhost:8080/Test/hello http://localhost:8080/test/hello Note: I don't change my Boot class in the /src/main/scala/ bootstrap/liftweb folder. Is there anyone can help ? Thanks very much! -- Lift, the simply functional web framework http://liftweb.net Beginning Scala http://www.apress.com/book/view/1430219890 Follow me: http://twitter.com/dpp Surf the harmonics --~--~-~--~~~---~--~~ 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: The LiftView trait can't work ?
Yeah, i use the Lift 1.0. I just want to test the LiftView trait, when i don't configure the viewDispatch in Boot Class and don't define the corresponding template (such as /Test/hello.html in webapp directory), then i type the http://localhost:8080/Test/hello; link that the View Class can to do it. Thank you for your reply that it's very helpful. I'll try to add /Test/hello in the SiteMap and test it again. Cheers, Neil On Sep 23, 11:19 pm, David Pollak feeder.of.the.be...@gmail.com wrote: If you're using Lift 1.0.x, the request will silently fail. If you're using Lift 1.1-x, you will get a helpful error message reminding you to add the /Test/hello link to your SiteMap in Boot.scala On Wed, Sep 23, 2009 at 1:02 AM, Neil.Lv anim...@gmail.com wrote: Hi all, Just I define a class that extends the LiftView trait, but there is something wrong with this class when i using it. I wrote some test code like this: ### code ### package com.test.view import net.liftweb._ import http._ import scala.xml.{NodeSeq} class Test extends LiftView { override def dispatch = { case hello = doTest _ } def doTest():NodeSeq = { lift:surround with=default at=content Time is: {new _root_.java.util.Date} /lift:surround } } ### code ### Use these links and always get this message The Requested URL / Test/hello was not found on this server http://localhost:8080/Test/hello http://localhost:8080/test/hello Note: I don't change my Boot class in the /src/main/scala/ bootstrap/liftweb folder. Is there anyone can help ? Thanks very much! -- Lift, the simply functional web frameworkhttp://liftweb.net Beginning Scalahttp://www.apress.com/book/view/1430219890 Follow me:http://twitter.com/dpp Surf the harmonics --~--~-~--~~~---~--~~ 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: The LiftView trait can't work ?
It works now that i add /test/hello into the SiteMap. Menu(Loc(Test, List(test, hello), Test)) But i have something questions about the SiteMap. If i have more and more these links in my application whether i must add these links one by one into the SiteMap ? Such as: Menu(Loc(Test, List(test, hello), Test)) :: Menu(...) :: Menu(...) :: Menu(...) ... Maybe this code will be very long whether there is another way to achieve this goal. Cheers, Neil On Sep 24, 9:39 am, Neil.Lv anim...@gmail.com wrote: Yeah, i use the Lift 1.0. I just want to test the LiftView trait, when i don't configure the viewDispatch in Boot Class and don't define the corresponding template (such as /Test/hello.html in webapp directory), then i type the http://localhost:8080/Test/hello; link that the View Class can to do it. Thank you for your reply that it's very helpful. I'll try to add /Test/hello in the SiteMap and test it again. Cheers, Neil On Sep 23, 11:19 pm, David Pollak feeder.of.the.be...@gmail.com wrote: If you're using Lift 1.0.x, the request will silently fail. If you're using Lift 1.1-x, you will get a helpful error message reminding you to add the /Test/hello link to your SiteMap in Boot.scala On Wed, Sep 23, 2009 at 1:02 AM, Neil.Lv anim...@gmail.com wrote: Hi all, Just I define a class that extends the LiftView trait, but there is something wrong with this class when i using it. I wrote some test code like this: ### code ### package com.test.view import net.liftweb._ import http._ import scala.xml.{NodeSeq} class Test extends LiftView { override def dispatch = { case hello = doTest _ } def doTest():NodeSeq = { lift:surround with=default at=content Time is: {new _root_.java.util.Date} /lift:surround } } ### code ### Use these links and always get this message The Requested URL / Test/hello was not found on this server http://localhost:8080/Test/hello http://localhost:8080/test/hello Note: I don't change my Boot class in the /src/main/scala/ bootstrap/liftweb folder. Is there anyone can help ? Thanks very much! -- Lift, the simply functional web frameworkhttp://liftweb.net Beginning Scalahttp://www.apress.com/book/view/1430219890 Follow me:http://twitter.com/dpp Surf the harmonics --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---