concept access in category lift

appears as: ccess, Access
Lift in Action: The Simply Functional Web Framework for Scala

This is an excerpt from Manning's book Lift in Action: The Simply Functional Web Framework for Scala.

Table 2.4. Directories created in the SBT project

Directory

Description

src/main/resources The resources directory is where you can place configuration and related files that you want to be packaged up with your application deployment WAR. The things you place here will be on the root class-path of the output package, so it’s usually a good place to hold things like logging configuration or other resources that you need access to at runtime. Lift’s configuration files (ending with .props) typically live in the resources/props folder.
src/main/scala This is where all the Scala and Lift code you write will be placed and managed from. By default, Lift will look for a Boot class in the bootstrap.liftweb package within your application. In the package name that you supplied earlier on the command line, several subpackages have been created with a sample HelloWorld.scala file for illustrative purposes.
src/main/webapp This directory holds all your XHTML markup files and any associated static resources you might want to use as part of your Lift application. The main difference between this setup and usual Java web applications is the templates-hidden directory. Lift has a very sophisticated templating system, and any markup files that are present in templates-hidden can only be used for templating and not for complete pages. More on this in chapter 6.

MappedEmail, on the other hand, is an extension of the standard MappedString implementation. You may well be wondering what the value of having a different concrete type for an email address verses a regular string is, because ultimately an email is a string. Although this is true, there are many things you might want to do with an email address, such as validating that it’s an email address and not just a random string of numbers and letters. By using this approach, you can have rich column types in your entities and get access to a whole set of helpers, depending upon the abstraction. Table 10.2 shows a list of rich column types available at the time of writing and includes a short description and example usage for each.

Listing 14.16. Making multiple HTTP calls in the same session
"Gain access to secret stuff if they are logged in" in { for { auth <- post("/testkit/services/login") !@ "Unable to login!" resp <- auth.get("/testkit/services/secret") !@ "Not authenticated" }{ resp must haveClass[HttpResponse] } }