lift

How to count rows in Lift (Scala's web framework)

I want to add a property to my User model that returns the number of rows in the Project table that have a user Id of the user. So something like this... def numProjects = { /* somehow get count from Project table The straight sql would be: SELECT COUNT(*) FROM projects WHERE userId = */ } ...

why is the lift web framework scalable?

I want to know the technical reasons why the lift webframework has high performance and scalability? I know it uses scala, which has an actor library, but according to the install instructions it default configuration is with jetty. So does it use the actor library to scale? Now is the scalability built right out of the box. Just add ...

Scala lift framework, ajax form that submits multiple values?

I am just getting started with lift and I am now trying to change a normal form to an ajax form but the method processEntryAdd is never called. def addUser(xhtml : Group) : NodeSeq = { var firstName = "" var lastName = "" def processEntryAdd() { Log.info("processEntryAdd: " + firstName + ", " + lastName) } ...

How can I construct and parse a JSON string in Scala / Lift

I am using JsonResponse to send some JSON to the client. I would like to test that I am building the correct message for a given input, so it seemed natural to me to parse the resulting JSON and validate against a data structure rather than parsing a string by hand. Lift's JsObj produces a string which uses single quotes. This is vali...

Is the lift framework as "easy" as ruby on rails or django?

Just wondering if anyone has experience with the three. I have used read through some RoR and used Django. They seem fairly easy to use. Is lift "easy" like these two are? I know easy is subjective and has no context here. I mean in a very high level and general sense. ...

lift snippet help

Hi, im just starting with lift and scala and have a problem i dont realy understand. i have the folowing index.html <html> <head><title>title</title></head> <body> <table> <lift:Members.list> <tr> <td><m:nick/></td> </tr> </lift:Members.list> </table> </body> And the f...

MVC on Lift/Scala

Has anyone tried to do a scala/lift application using MVC instead of view-first? I know that you can create Controllers/views as: package test.test.test.view ... Lots of imports ... class MvcRocks extends LiftView { def dispatch = { case "rule" => ruleDispatch _ case "bar" => barDispatch _ } def barDispatch(): Box[NodeSe...

Scala/Lift question rss feed fetch

I'm looking for a simple line or two of code that will grab an rss feed like this php line: $feed = "URL" from within a scala object. I'm using scala/lift with Netbeans or Eclipse if it's relevant ...

Grails - Lift: Which framework is better suited for which kind of applications?

I have been using Grails for the past few months and I really like it, specially GORM. However, I am getting interested into Scala's Lift. Therefore, I would like to know your opinion about which kind of web apps are better suited for which of those two frameworks or it is just a matter of taste, which framework to use? Finally, which o...

What is the meaning of colon, underscore and star in lift's SiteMap(entries:_*) ?

I'm learning Scala and lift at the same time and I got stuck on understanding the syntax used to inintialize the SiteMap in the Boot.scala: val entries = Menu(Loc("Home", "/", "Home")) :: Menu(Loc("Foo", "/badger", "Foo")) :: Menu(Loc("Directory Foo", "/something/foo", "Directory Foo")) :: Nil LiftRules.setSiteMap(Site...

lift net.liftweb.http.S#param doesnt works like wiki says

i try to copying the examples in wiki http://wiki.liftweb.net/index.php/Hello_Darwin in the example of HelloForm2.scala "submit" -> submit(?("Send"), () => {println("value:" + who + " :: " + param("whoField"))}), it always print "value:Full(hogehoge) :: Empty" even if i set the who as "object who extends RequestVar(Full("world"))". ...

Strangeness with Jetty serving images

I'm completely stumped. I'll give the background for the sake of completeness but I'm not sure if it will help or not. I'm running a Lift project on a standard Jetty set-up running one Lift instance. Mac OS X. I have a snippet which transforms the XML input, renders an image, saves it to disc under the webroot/images/ directory with a f...

Lift RewriteResponse not finding a valid url

Hi I'm having some trouble with Lift and URL rewriting. I've written a simple rewrite rule: LiftRules.rewrite.append { case RewriteRequest( ParsePath(List("user", userID), _, _, _), _, _) => { println(userID) RewriteResponse(List("viewUser"), Map("userID" -> urlDecode(userID))) } } So when I enter http://loca...

Lift: how to retrieve the current logged in user?

I'm starting to learn Lift and I'm stuck. I have problem with simple snippet: class Util { def in(html: NodeSeq) : NodeSeq ={ if (User.loggedIn_?) Helpers.bind("user", html, "name" -> User.currentUser.map(_.lastName).open_!) else NodeSeq.Empty } It should inject current User name, but ...

scala / lift example of form processing

Can I get a simple example of a Lift form submission and processor? I've seen the Lift hello world, which was pretty trivial and didn't really give a flavor for how it works. I'm coming from a spring MVC background, but I have some FP experience. ...

Method Dependencies and Error Handling

I'm making a small issue management system in Lift to learn both Scala and Lift. I have a view that displays a single issue belonging to a project. Before I bind data to the view template, I want to check that I have all data required, so I want to specifically check that: A project ID param has been supplied A Project exists with the...

Drawbacks to using Lift (Scala-based framework) for webservices?

I have been working on a project and as I have just started on the webservice I found Lift has been released, so I am curious if there will be much more complication by using Lift over Jax-WS using JDK6. I am doing this with the Eclipse IDE, but I don't know if I will get much benefit from the IDE on this project. ...

How to create stand-alone lift web application?

How to make a standalone lift application? Which tools/libraries to use? How does the performance compare to using lift application as a war in some application server? ...

Getting lift sources from maven repository

I'm trying to learn how to use lift. I can create project skeleton by running maven commands (I had zero maven experience before) from Starting with Lift. It successfully downloads needed dependencies and everything works fine, however it does not download sources - I'd like to see how lift works from inside. Looks like it downloads de...

How to start playing with Lift framework?

What I think would be useful for me (and hopefully for other SO readers and Scala fans) is: How to painlessly set up lift on linux (ubuntu) (apt-get install lift #does not work) Is there any free server where I can run lift and Scala? I have no experience with Java or maven or Eclipse. (but have some experience with functional progra...