| Table of Contents | 1 |
|---|
| The Definitive Guide to Lift: A Scala-Based Web Framework | 8 |
|---|
| Acknowledgements | 9 |
|---|
| Chapter 1: Welcome to Lift | 10 |
|---|
| Lifting Off! | 10 |
| Implementing the View-First Pattern with Lift | 10 |
| Leveraging the Scala Language | 11 |
| Supporting Advanced Features Easily | 12 |
| Getting to Know the Lift Community | 12 |
| Creating Your First Lift Application | 13 |
| Conclusion | 18 |
| Chapter 2: PocketChange | 19 |
|---|
| Keeping Track of Your PocketChange | 19 |
| Defining the Model | 20 |
| Creating Your First Template | 23 |
| Writing Snippets | 24 |
| Sprinkling a Little AJAX Spice | 27 |
| Conclusion | 31 |
| Chapter 3: Lift Fundamentals | 32 |
|---|
| Entering Lift | 32 |
| Making Standard import Assumptions for This Book | 33 |
| Bootstrapping in Lift | 33 |
| Using LiftRules | 33 |
| Resolving Classes | 34 |
| Rendering in Lift | 34 |
| Rendering with Templates | 35 |
| Rendering with Views | 36 |
| Getting to Know the Lift Tags | 38 |
| snippet | 38 |
| surround | 39 |
| bind | 40 |
| embed | 40 |
| comet | 40 |
| Merging HTML Headings | 41 |
| Providing User Feedback | 42 |
| Using Snippets | 42 |
| Binding Values in Snippets | 43 |
| Choosing Between Stateless and Stateful Snippets | 44 |
| Using Eager Evaluation | 45 |
| Rewriting URLs | 45 |
| Adding Custom Dispatch Functions | 48 |
| Using HTTP Redirects | 50 |
| Using Cookies | 50 |
| Storing Session and Request States | 51 |
| Gathering a Few More Useful Objects | 53 |
| S object | 53 |
| SHtml | 53 |
| Conclusion | 53 |
| Chapter 4: Forms in Lift | 54 |
|---|
| Practicing Form Fundamentals | 54 |
| checkbox | 59 |
| hidden | 60 |
| link | 60 |
| text and password | 61 |
| textarea | 62 |
| submit | 62 |
| multiselect | 62 |
| radio | 63 |
| select | 64 |
| selectObj | 65 |
| untrustedSelect | 65 |
| Uploading Files | 65 |
| Conclusion | 67 |
| Chapter 5: SiteMap | 68 |
|---|
| Defining SiteMap | 68 |
| Creating the Link Class | 68 |
| Using ExtLink | 69 |
| Creating Menu Entries | 69 |
| Using Nested Menus | 70 |
| Setting the Global SiteMap | 71 |
| Customizing the Display | 72 |
| Using the Hidden LocParam | 72 |
| Controlling the Menu Text | 72 |
| Using Menu | 73 |
| Controlling Access with Menus | 74 |
| Using If Clauses | 74 |
| Using the Unless LocParam | 75 |
| Working with the Template LocParam | 75 |
| Working with the Snippet and LocSnippets Parameters | 76 |
| Setting the Title | 77 |
| Testing a Request | 77 |
| Categorizing with LocGroup | 78 |
| Writing Your Own Loc | 78 |
| Knowing the Corresponding Functions | 79 |
| Using Type-Safe Parameters | 80 |
| Conclusion | 84 |
| Chapter 6: Mapper and Record | 85 |
|---|
| Introducing Mapper and MetaMapper | 85 |
| Adding Mapper to Your Project | 86 |
| Setting Up the Database Connection | 86 |
| Constructing a Mapper-Enabled Class | 87 |
| Creating Object Relationships | 90 |
| Indexing | 93 |
| Mapping Schemas | 93 |
| Performing Persistence Operations on an Entity | 94 |
| Creating a Mapper Instance | 95 |
| Saving a Mapper Instance | 96 |
| Deleting a Mapper Instance | 96 |
| Querying for Entities | 96 |
| Using Comparison QueryParams | 97 |
| Using Control QueryParams | 99 |
| Making Joins a Little Friendlier | 101 |
| Using Utility Functionality | 101 |
| Generating a Display | 101 |
| Generating Forms | 102 |
| Validating Forms | 103 |
| Supporting CRUD Operations | 104 |
| Using Life Cycle Callbacks | 105 |
| Knowing the Base Field Types | 105 |
| Defining Custom Field Types | 108 |
| Working with ProtoUser and MegaProtoUser | 113 |
| Using Advanced Mapper Features | 114 |
| Using Multiple Databases | 114 |
| Performing SQL-Based Queries | 117 |
| Conclusion | 119 |
| Chapter 7: Advanced Lift Architecture | 120 |
|---|
| Understanding Lift Architecture | 120 |
| Understanding the Request/Response Life Cycle | 121 |
| Transforming a Request into a Response | 122 |
| Processing a Stateful Request | 123 |
| Mapping Lift Functions | 125 |
| Exploring LiftResponse in Detail | 127 |
| Basic HTTP Equivalent Responses | 127 |
| Redirecting the Client | 128 |
| Sending Content to the Client | 129 |
| InMemoryResponse | 130 |
| StreamingResponse | 130 |
| Returning Text to the Client | 131 |
| Returning XML to the Client | 131 |
| Managing Sessions | 132 |
| Using Sticky Sessions | 133 |
| Using Lift’s Garbage Collection | 134 |
| Wrapping Lift’s Processing Logic | 135 |
| Using Additional Snippet Features | 137 |
| Passing Parameters to Snippets | 137 |
| Using Snippets for Tag Attributes | 137 |
| Working with Advanced S Object Features | 139 |
| Managing Cookies | 139 |
| Managing the Time Zone | 140 |
| Setting Session DispatchPF Functions | 140 |
| Rewriting Sessions | 140 |
| Accessing HTTP Headers | 140 |
| Managing the Document Type | 141 |
| Performing Other Functions | 141 |
| Managing Resources with ResourceServer | 141 |
| Obtaining HTTP Authentication | 142 |
| Using Basic HTTP Authentication | 142 |
| Using HTTP Digest Authentication | 145 |
| Conclusion | 147 |
| Chapter 8: Lift and JavaScript | 148 |
|---|
| Using High-Level JavaScript Abstractions | 148 |
| Understanding JsCmd and JsExp | 149 |
| Exploring JavaScript Abstraction Examples | 152 |
| Using jQuery and Other JavaScript Frameworks | 153 |
| Using XML and Jav
|