The book is at http://www.apress.com/book/view/1430224215#
The book is also free at http://groups.google.com/group/the-lift-book
The Lift home page is at http://liftweb.net/
The first example in Chapter 1 is a simple Lift skeleton. Install Maven, make a work folder C:\lift_work, then from there run a single statement to make your first web app:
C:\lift_work>mvn archetype:generate -U -DarchetypeGroupId=net.liftweb -DarchetypeArtifactId=lift-archetype-blank
-DarchetypeVersion=1.0 -DgroupId=demo.helloworld -DartifactId=helloworld -Dversion=1.0-SNAPSHOT
Maven gets everything you need. Then, at C:\lift_work\helloworld type mvn jetty:run
Jetty is installed and I am running the Lift skeleton example at localhost:8080
The rest of the book explains an example called Pocket Change. To get the Pocket Change example source code, you first have to install git at http://code.google.com/p/msysgit/downloads/list
and then issue a git clone command:
$ git clone git://github.com/tjweir/pocketchangeapp.git
Initialized empty Git repository in C:/Documents and Settings/Walt/pocketchangeapp/.git/
remote: Counting objects: 821, done.
remote: Compressing objects: 100% (530/530), done.
remote: Total 821 (delta 277), reused 412 (delta 127)
Receiving objects: 100% (821/821), 148.06 KiB, done.
Resolving deltas: 100% (277/277), done.
The Pocket Change app that git put in my Documents and Settings folder looks strikingly similar to the helloworld demo.
I put it in C:lift_pocketchange and then compared it to helloworld:
At C:\lift_pocketchange\PocketChange, type mvn jetty:run
A ton of downloads are collected, then:
[INFO] Compiling 13 source files to C:\lift_pocketchange\PocketChange\target\cla
sses
warning: there were unchecked warnings; re-run with -unchecked for details
one warning found
[INFO] [resources:testResources]
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources,
i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory C:\lift_pocketchange\PocketChange\src
\test\resources
[INFO] [compiler:testCompile]
[INFO] No sources to compile
[INFO] [scala:testCompile {execution: default}]
[INFO] Checking for multiple versions of scala
[INFO] includes = [**/*.scala,**/*.java,]
[INFO] excludes = []
[WARNING] No source files found.
[INFO] [jetty:run]
[INFO] Configuring Jetty for project: PocketChangeApp
[INFO] Webapp source directory = C:\lift_pocketchange\PocketChange\src\main\weba
pp
[INFO] Reload Mechanic: automatic
[INFO] Classes = C:\lift_pocketchange\PocketChange\target\classes
2009-10-07 08:03:34.437::INFO: Logging to STDERR via org.mortbay.log.StdErrLog
[INFO] Context path = /
[INFO] Tmp directory = determined at runtime
[INFO] Web defaults = org/mortbay/jetty/webapp/webdefault.xml
[INFO] Web overrides = none
[INFO] web.xml file = C:\lift_pocketchange\PocketChange\src\main\webapp\WEB-INF\
web.xml
[INFO] Webapp directory = C:\lift_pocketchange\PocketChange\src\main\webapp
[INFO] Starting jetty 6.1.21 ...
2009-10-07 08:03:34.796::INFO: jetty-6.1.21
2009-10-07 08:03:35.500::INFO: No Transaction manager found - if your webapp re
quires one, please configure one.
INFO - CREATE TABLE users (firstname VARCHAR(32) , lastname VARCHAR(32) , email
VARCHAR(48) , locale VARCHAR(16) , timezone VARCHAR(32) , password_pw VARCHAR(48
) , password_slt VARCHAR(20) , superuser BOOLEAN , validated BOOLEAN , uniqueid
VARCHAR(32) , id BIGINT NOT NULL AUTO_INCREMENT)
INFO - CREATE TABLE tag (account BIGINT , name VARCHAR(64) , id BIGINT NOT NULL
AUTO_INCREMENT)
INFO - CREATE TABLE account (externalaccount VARCHAR(300) , balance DECIMAL(16,2
) , is_public BOOLEAN , name VARCHAR(100) , id BIGINT NOT NULL AUTO_INCREMENT ,
description VARCHAR(300) , owner BIGINT)
INFO - CREATE TABLE accountadmin (administrator BIGINT , account BIGINT , id BIG
INT NOT NULL AUTO_INCREMENT)
INFO - CREATE TABLE accountviewer (viewer BIGINT , account BIGINT , id BIGINT NO
T NULL AUTO_INCREMENT)
INFO - CREATE TABLE accountnote (note LONGVARCHAR , account BIGINT , id BIGINT N
OT NULL AUTO_INCREMENT)
INFO - CREATE TABLE expense (dateof TIMESTAMP , amount DECIMAL(16,2) , descripti
on VARCHAR(100) , notes VARCHAR(1000) , serialnumber BIGINT , account BIGINT , c
urrentbalance DECIMAL(16,2) , receiptmime VARCHAR(100) , receipt BINARY , id BIG
INT NOT NULL AUTO_INCREMENT)
INFO - CREATE TABLE expensetag (expense BIGINT , id BIGINT NOT NULL AUTO_INCREME
NT , tag BIGINT)
INFO - CREATE INDEX users_email ON users ( email )
INFO - CREATE INDEX users_uniqueid ON users ( uniqueid )
INFO - CREATE INDEX users_id ON users ( id )
INFO - CREATE INDEX tag_account ON tag ( account )
INFO - CREATE INDEX tag_id ON tag ( id )
INFO - CREATE INDEX account_id ON account ( id )
INFO - CREATE INDEX account_owner ON account ( owner )
INFO - CREATE INDEX accountadmin_administrator ON accountadmin ( administrator )
INFO - CREATE INDEX accountadmin_account ON accountadmin ( account )
INFO - CREATE INDEX accountadmin_id ON accountadmin ( id )
INFO - CREATE INDEX accountviewer_viewer ON accountviewer ( viewer )
INFO - CREATE INDEX accountviewer_account ON accountviewer ( account )
INFO - CREATE INDEX accountviewer_id ON accountviewer ( id )
INFO - CREATE INDEX accountnote_account ON accountnote ( account )
INFO - CREATE INDEX accountnote_id ON accountnote ( id )
INFO - CREATE INDEX expense_account ON expense ( account )
INFO - CREATE INDEX expense_id ON expense ( id )
INFO - CREATE INDEX expensetag_expense ON expensetag ( expense )
INFO - CREATE INDEX expensetag_id ON expensetag ( id )
INFO - CREATE INDEX expensetag_tag ON expensetag ( tag )
INFO - Bootstrap up
2009-10-07 08:03:40.140::INFO: Started SelectChannelConnector@0.0.0.0:8080
[INFO] Started Jetty Server
[INFO] Starting scanner at interval of 5 seconds.
INFO - Service request (POST) /ajax_request/F68898529630UFU/ took 578 Millisecon
ds
INFO - Service request (GET) / took 1328 Milliseconds
INFO - Service request (GET) /classpath/blueprint/screen.css took 172 Millisecon
ds
INFO - Service request (GET) /classpath/blueprint/print.css took 62 Milliseconds
INFO - Service request (GET) /classpath/blueprint/ie.css took 0 Milliseconds
INFO - Service request (GET) /classpath/blueprint/plugins/fancy-type/screen.css
took 0 Milliseconds
INFO - Service request (GET) /classpath/jquery.js took 31 Milliseconds
INFO - Service request (GET) /classpath/json.js took 16 Milliseconds
INFO - Service request (GET) /scripts/jquery.bgiframe.js took 31 Milliseconds
INFO - Service request (GET) /ajax_request/liftAjax.js took 47 Milliseconds
Now I have a target folder:
And the demo is instantly running. This is how life should be. This is a triumph of civilization.
Except that the "Add Expense" button does nothing. Oh well, time to find some more hello world tutorials before I take that on.





