Book description
If you need help building web applications with the Lift framework, this cookbook provides scores of concise, ready-to-use code solutions. You’ll find recipes for everything from setting up a coding environment to creating REST web services and deploying your application to production.
Built on top of the Scala JVM programming language, Lift takes a different—yet ultimately easier—approach to development than MVC frameworks such as Rails. Each recipe in this book includes a discussion of how and why each solution works, not only to help you complete the task at hand, but also to illustrate how Lift works.
- Set up an environment and run your first Lift application
- Generate HTML, using Lift’s View First approach
- Submit forms and work with form elements
- Build REST web services with the framework’s RestHelper trait
- Take advantage of Lift’s support for Ajax and Comet
- Get examples for modifying Lift’s request pipeline
- Convert Scala classes into tables, rows, and columns in a relational database
- Send email, call URLs, and schedule tasks from your application
- Package and deploy your application to various hosted services
Publisher resources
Table of contents
- Lift Cookbook
- Preface
- 1. Installing and Running Lift
-
2. HTML
- Testing and Debugging CSS Selectors
- Sequencing CSS Selector Operations
- Setting Meta Tag Contents
- Setting the Page Title
- HTML Conditional Comments
- Returning Snippet Markup Unchanged
- Snippet Not Found When Using HTML5
- Avoiding CSS and JavaScript Caching
- Adding to the Head of a Page
- Custom 404 Page
- Other Custom Status Pages
- Links in Notices
- Link to Download Data
- Test on a Req
- Rendering Textile Markup
- 3. Forms Processing in Lift
- 4. REST
-
5. JavaScript, Ajax, and Comet
- Trigger Server-Side Code from a Button
- Call Server When Select Option Changes
- Creating Client-Side Actions in Your Scala Code
- Focus on a Field on Page Load
- Add a CSS Class to an Ajax Form
- Running a Template via JavaScript
- Move JavaScript to End of Page
- Run JavaScript on Comet Session Loss
- Ajax File Upload
- Format a Wired Cell
- 6. Request Pipeline
-
7. Relational Database Persistence with Record and Squeryl
- Configuring Squeryl and Record
- Using a JNDI DataSource
- One-to-Many Relationship
- Many-to-Many Relationship
- Adding Validation to a Field
- Custom Validation Logic
- Modify a Field Value Before It Is Set
- Testing with Specs
- Store a Random Value in a Column
- Automatic Created and Updated Timestamps
- Logging SQL
- Model a Column with MySQL MEDIUMTEXT
- MySQL Character Set Encoding
- 8. MongoDB Persistence with Record
- 9. Around Lift
- 10. Production Deployment
- 11. Contributing, Bug Reports, and Getting Help
- Index
- About the Author
- Colophon
- Copyright
Product information
- Title: Lift Cookbook
- Author(s):
- Release date: June 2013
- Publisher(s): O'Reilly Media, Inc.
- ISBN: 9781449362683
You might also like
book
Lift in Action
Lift in Action is a step-by-step exploration of the Lift framework. It moves through the subject …
article
Run Llama-2 Models Locally with llama.cpp
Llama is Meta’s answer to the growing demand for LLMs. Unlike its well-known technological relative, ChatGPT, …
article
Have ChatGPT Ask You Questions
ChatGPT Shortcuts shows future prompt engineers how to harness the full potential of the state-of-the-art AI …
video
GenAI Essentials for Everyone - Overview
Our team of experts has hand-selected and organized the most crucial concepts and practical applications of …