lift

Is this correct way to handle RESTful like URL in Lift Framework?

If I have a URL like http://localhost/Test/edit/{id} and I would like the {id} transform to a parameter instead of URL path part. Is it best way to do it by create a menu with RewriteRequest? Because I found it a little boilerplate if I have lot URL pattern like this. val menu = Menu(new Loc[Unit] { override def name = "Test" ...

Common Programming Mistakes for Lift Developers to Avoid

In the spirit of Common programming mistakes for Scala developers to avoid and family. What are the best practices and common mistakes to avoid when developing for the lift / liftweb framework? More specifically, what are the issues that affect Lift development, as distinct from generic Scala development? ...

Scala and Lift and SessionVar that loses it contents

I have SessionVar like this in Lift: object MyObject { object myVar extends SessionVar[Box[MyObject]](Empty) } Then I set value once for myVar: MyObject.myVar(Full(value)) My problem is that after some time (1-5 mins) myVar will lose its value, that is, it will have value Empty again. This is not due inactivity since I am click...

lift import net.liftweb returns an error "not found: value net"

Hi, I'm new with scala and lift but I already got the pocketchangeapp up and running and playing around with the RestAPI thing in it. Now I created a new project and it worked quite well until last night. I made my latest changes and commited them in svn but hat a problem with my workspace so I deleted my projects and did a checkout of ...

Saving a Json extraction in Lift.

I'm trying to save data parced with Lifts' Json data extraction and save it to the database(via mapper) but I cannot find where to connect the snippit to the mapper. The code looks like this. Here is a test snippit. package com.testjson.snippet import dispatch._ import net.liftweb.json.JsonParser._ import java.io.{ByteArrayOutputStrea...

How to use the scala dispatch library to send a post request to the server in the Lift ?

Hi all, How to use the scala dispatch library to send a post request to the server in the Lift ? I want to send a post request to the external server get some information and then use this information in my web app. Is there any demo code can be applied that will be appreciated ! Thanks Cheers. Neil ...

ORM for Lift: Mapper or JPA?

Hi everybody, I'm creating a small application for my company in Lift. I'm quite a newbie in Scala/Lift so I'm using this chance to practice. Now, I have a question on what ORM system to use. On one hand, Mapper is the Lift default. On the other hand, I've read it's not good in certain areas and will be replaced by Record (which is not...

Liftweb Menu customization

I want to create a menu that looks like: HOME | FOO | BAR | ABOUT | CONTACT How might I go about doing this? Here is what I have tried: <lift:Menu.builder ul:class="menu" li_item:class="current" /> and ul.menu li { display: inline; list-style-type: none; text-transform: uppercase; border-right: 1px solid white; padd...

How to catch exceptions and redirect to error page in Lift?

How to make error handlers in Lift? I have html page with some snippets, if one of those snippets throws an exception I want to catch it and redirect to some user friendly error page. How to do this in catch-all manner? I do not want to put error handling to each snippet separately. I am looking something like this in Wicket. ...

How scalable is the Lift framework's comet/reverse ajax?

I recently learned scala and about to start working/learning Lift framework. Going through the Features and getting started with the framework, I had seen some amazing capabilities of the framework including the reverse ajax and comet. Earlier in my experience I had really really bad experience with the reverse ajax which never scaled. I...

How to create xhtml query strings with Scala?

How do I create an x(ht)ml-Node containing a href-attribute including a query string without the &s being escaped automatically or runtime error? val text = Text("?key=val&key2=val2") will be escaped and val node = <a href="link?key=val&key2=val2">link</a> throws (in Scala 2.7.5): java.lang.AssertionError The node will be used w...

maven and lift using scala 2.8 : lift-mapper missing?

Newbie question since I'm not up to speed using maven at all. I'm trying to use scala + lift using scala 2.8, environment is a win7 box if that matters. I create a basic project using: mvn archetype:generate -U -DarchetypeGroupId=net.liftweb -DarchetypeArtifactId=lift-archetype-basic -DarchetypeVersion=2.0-scala280-SNAPSHOT -Da...

Is there a way to use pre-existing JSP Tag libraries within the Lift framework (e.g. via snippets)?

Hi, I'm fairly new to Lift/Scala but like the ideas of less code writing and function passing etc. I've had a brief look at the Lift web framework but was wondering if it is at all possible to leverage pre-existing JSP Tag libraries, ideally while being able to still place/mix with Lift's snippet tags? As Scala is able to utilise norm...

DocBook sources of "Starting with Lift"

By the looks of it, I wouldn't be surprised if "Starting with Lift" has been created from DocBook. I looked in Lift's Git repositories, but I haven't been able to find the source DocBook documents. So, is it really based on DocBook? And if it is, is it available from some public repository? ...

What type of webapp is the sweet spot for Scala's Lift framework?

What kind of applications are the sweet spot for Scala's lift web framework. My requirements: Ease of development and maintainability Ready for production purposes. i.e. good active online community, regular patches and updates for security and performance fixes etc. Framework should survive a few years. I don't want to write a app in...

using REST webservices as a datasource for Lift ?

Is there a way to use a webservice (REST in this case) as the data source for a Lift application? I can find a number of tutorials/examples of using Lift to provide the REST API, but in my case the data is hosted elsewhere and exported as a REST webservice. Pointers to doc are greatly appreciated. Thanks, Jeff ...

Optional attribute values in MappedField

I'm new to Scala and Lift, coming from a slightly odd background in PLT Scheme. I've done a quick search on this topic and found lots of questions but no answers. I'm probably looking in the wrong place. I've been working my way through tutorials on using Mapper to create database-backed objects, and I've hit a stumbling block: what typ...

lift `??` construct

Hi, I have browsed lift's MegaProtoUser and encountered this construction: ??("Last Name"). Can anyone explain, what that means? Thanks for answering ...

Why would I use Scala/Lift over Java/Spring?

Hi, I know this question is a bit open but I have been looking at Scala/Lift as an alternative to Java/Spring and I am wonder what are the real advantages that Scala/Lift has over it. From my perspective and experience, Java Annotations and Spring really minimizes the amount of coding that you have to do for an application. Does Scala/L...

`sbt package` results in huge war file - how to make it smaller?

Hey all, I'm currently using SBT to manage my Lift project. I'd like to deploy it, but when I run 'sbt package' it produces a 60MB war file. This seems pretty large - are there ways I could cut down the size? Thanks! ...