Thursday September 03, 2009
TOTD #100: Getting Started with Scala Lift on GlassFish v3
Yaaay, 100th tip! Read earlier tips here.
![]() |
Scala is a strongly typed JVM language that provides benefits of functional programming and dynamic languages on the JVM. As a result you get flexibility of language such as Ruby and performance of Java. Lift is an MVC-based Web framework, based on Scala, that claims to pick the best of Rails (ease of development), Seaside (highly granular sessions and security), Django (access control), and Wicket (designer-friendly templating system). |
Lift applications can run inside any Java application server. GlassFish v3 can run Rails and Django applications natively and can also run Wicket applications. This Tip Of The Day (TOTD) explains how to get started with Lift applications and run inside GlassFish v3.
~/samples/v3/lift >mvn archetype:generate -U -DarchetypeGroupId=net.liftweb
-DarchetypeArtifactId=lift-archetype-blank -DarchetypeVersion=1.0
-DremoteRepositories=http://scala-tools.org/repo-releases
-DgroupId=demo.helloworld -DartifactId=helloworld
-Dversion=1.0-SNAPSHOT
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'archetype'.
[INFO] org.apache.maven.plugins: checking for updates from central
. . .
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 14 seconds
[INFO] Finished at: Tue Sep 01 16:11:34 PDT 2009
[INFO] Final Memory: 12M/80M
[INFO] ------------------------------------------------------------------------
~/samples/v3/lift/helloworld >find .
.
./pom.xml
./src
./src/main
./src/main/resources
./src/main/scala
./src/main/scala/bootstrap
./src/main/scala/bootstrap/liftweb
./src/main/scala/bootstrap/liftweb/Boot.scala
./src/main/scala/demo
./src/main/scala/demo/helloworld
./src/main/scala/demo/helloworld/comet
./src/main/scala/demo/helloworld/comet/.keep
./src/main/scala/demo/helloworld/model
./src/main/scala/demo/helloworld/model/.keep
./src/main/scala/demo/helloworld/snippet
./src/main/scala/demo/helloworld/snippet/.keep
./src/main/scala/demo/helloworld/snippet/HelloWorld.scala
./src/main/scala/demo/helloworld/view
./src/main/scala/demo/helloworld/view/.keep
./src/main/webapp
./src/main/webapp/index.html
./src/main/webapp/templates-hidden
./src/main/webapp/templates-hidden/default.html
./src/main/webapp/WEB-INF
./src/main/webapp/WEB-INF/web.xml
./src/test
./src/test/resources
./src/test/scala
./src/test/scala/demo
./src/test/scala/demo/helloworld
./src/test/scala/demo/helloworld/AppTest.scala
./src/test/scala/LiftConsole.scala
./src/test/scala/RunWebApp.scala
~/samples/v3/lift/helloworld >mvn package [INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building helloworld
[INFO] task-segment: [package]
[INFO] ------------------------------------------------------------------------
[INFO] artifact org.scala-tools:maven-scala-plugin: checking for updates from scala-tools.org
[INFO] artifact org.scala-tools:maven-scala-plugin: checking for updates from central
. . .
[INFO] Building war: /Users/arungupta/samples/v3/lift/helloworld/target/helloworld-1.0-SNAPSHOT.war
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 9 minutes 25 seconds
[INFO] Finished at: Tue Sep 01 16:42:32 PDT 2009
[INFO] Final Memory: 24M/80M
[INFO] ------------------------------------------------------------------------
~/tools/glassfish/v3/61/glassfishv3 >./bin/asadmin start-domain --verbose
Sep 2, 2009 3:43:09 PM com.sun.enterprise.admin.launcher.GFLauncherLogger info
INFO: JVM invocation command line:
. . .
Sep 2, 2009 3:46:01 PM OSGiModuleImpl start
INFO: Started bundle org.glassfish.security [174]
Sep 2, 2009 3:46:02 PM OSGiModuleImpl start
INFO: Started bundle org.glassfish.deployment.javaee-full [51]
~/samples/v3/lift/helloworld >~/tools/glassfish/v3/8-31/glassfishv3/bin/asadmin deploy target/helloworld-1.0-SNAPSHOT.war
Command deploy executed successfully.
What application server are you using to deploy your Lift applications ?
Please leave suggestions on other TOTD that you’d like to see. A complete archive of all the tips is available here.
Technorati: totd scala lift glassfish v3
Posted by Arun Gupta in General | Comments[0]
|
|
|
|
| Bollywood Dandia in Fremont on Sep 26, 2009 - Sharvari Dixit and Troupe
Content available at: http://blog.arungupta.me/2009/09/bollywood-dandia-in-fremont-on-sep-26-2009-sharvari-dixit-and-troupe/.
Posted by Arun Gupta in General | Comments[0]
|
|
|
|
|
Today's Page Hits: 2832
Total # blog entries: 1009