Lift Cookbook
Paperback Engels 2013 9781449362683Samenvatting
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 applicationGenerate HTML, using Lift’s View First approachSubmit forms and work with form elementsBuild REST web services with the framework’s RestHelper traitTake advantage of Lift’s support for Ajax and CometGet examples for modifying Lift’s request pipelineConvert Scala classes into tables, rows, and columns in a relational databaseSend email, call URLs, and schedule tasks from your applicationPackage and deploy your application to various hosted services
Specificaties
Lezersrecensies
Inhoudsopgave
Contributors;
Source;
Updates;
Software Versions;
Conventions Used in This Book;
Using Code Examples;
Safari® Books Online;
How to Contact Us;
Acknowledgments;
Chapter 1: Installing and Running Lift;
1.1 Downloading and Running Lift;
1.2 Creating a Lift Project from Scratch Using SBT;
1.3 Developing Using a Text Editor;
1.4 Incorporating JRebel;
1.5 Developing Using Eclipse;
1.6 Developing Using IntelliJ IDEA;
1.7 Viewing the lift_proto H2 Database;
1.8 Using the Latest Lift Build;
1.9 Using a New Version of Scala;
Chapter 2: HTML;
2.1 Testing and Debugging CSS Selectors;
2.2 Sequencing CSS Selector Operations;
2.3 Setting Meta Tag Contents;
2.4 Setting the Page Title;
2.5 HTML Conditional Comments;
2.6 Returning Snippet Markup Unchanged;
2.7 Snippet Not Found When Using HTML5;
2.8 Avoiding CSS and JavaScript Caching;
2.9 Adding to the Head of a Page;
2.10 Custom 404 Page;
2.11 Other Custom Status Pages;
2.12 Links in Notices;
2.13 Link to Download Data;
2.14 Test on a Req;
2.15 Rendering Textile Markup;
Chapter 3: Forms Processing in Lift;
3.1 Plain Old Form Processing;
3.2 Ajax Form Processing;
3.3 Ajax JSON Form Processing;
3.4 Use a Date Picker for Input;
3.5 Making Suggestions with Autocomplete;
3.6 Offering Choices with Radio Buttons;
3.7 Conditionally Disable a Checkbox;
3.8 Use a Select Box with Multiple Options;
3.9 File Upload;
Chapter 4: REST;
4.1 DRY URLs;
4.2 Missing File Suffix;
4.3 Missing .com from Email Addresses;
4.4 Failing to Match on a File Suffix;
4.5 Accept Binary Data in a REST Service;
4.6 Returning JSON;
4.7 Google Sitemap;
4.8 Calling REST Service from a Native iOS Application;
Chapter 5: JavaScript, Ajax, and Comet;
5.1 Trigger Server-Side Code from a Button;
5.2 Call Server When Select Option Changes;
5.3 Creating Client-Side Actions in Your Scala Code;
5.4 Focus on a Field on Page Load;
5.5 Add a CSS Class to an Ajax Form;
5.6 Running a Template via JavaScript;
5.7 Move JavaScript to End of Page;
5.8 Run JavaScript on Comet Session Loss;
5.9 Ajax File Upload;
5.10 Format a Wired Cell;
Chapter 6: Request Pipeline;
6.1 Debugging a Request;
6.2 Running Code When Sessions Are Created (or Destroyed);
6.3 Run Code When Lift Shuts Down;
6.4 Running Stateless;
6.5 Catch Any Exception;
6.6 Streaming Content;
6.7 Serving a File with Access Control;
6.8 Access Restriction by HTTP Header;
6.9 Accessing HttpServletRequest;
6.10 Force HTTPS Requests;
Chapter 7: Relational Database Persistence with Record and Squeryl;
7.1 Configuring Squeryl and Record;
7.2 Using a JNDI DataSource;
7.3 One-to-Many Relationship;
7.4 Many-to-Many Relationship;
7.5 Adding Validation to a Field;
7.6 Custom Validation Logic;
7.7 Modify a Field Value Before It Is Set;
7.8 Testing with Specs;
7.9 Store a Random Value in a Column;
7.10 Automatic Created and Updated Timestamps;
7.11 Logging SQL;
7.12 Model a Column with MySQL MEDIUMTEXT;
7.13 MySQL Character Set Encoding;
Chapter 8: MongoDB Persistence with Record;
8.1 Connecting to a MongoDB Database;
8.2 Storing a Hash Map in a MongoDB Record;
8.3 Storing an Enumeration in MongoDB;
8.4 Embedding a Document Inside a MongoDB Record;
8.5 Linking Between MongoDB Records;
8.6 Using Rogue;
8.7 Storing Geospatial Values;
8.8 Running Queries from the Scala Console;
8.9 Unit Testing Record with MongoDB;
Chapter 9: Around Lift;
9.1 Sending Plain-Text Email;
9.2 Logging Email Rather than Sending;
9.3 SMTP Authentication;
9.4 Sending Authenticated Email;
9.5 Sending Email with Attachments;
9.6 Run a Task Later;
9.7 Run Tasks Periodically;
9.8 Fetching URLs;
Chapter 10: Production Deployment;
10.1 Deploying to CloudBees;
10.2 Deploying to Amazon Elastic Beanstalk;
10.3 Deploying to Heroku;
10.4 Distributing Comet Across Multiple Servers;
Chapter 11: Contributing, Bug Reports, and Getting Help;
11.1 You’d Like Some Help;
11.2 How to Report Bugs;
11.3 Contributing Small Code Changes and ScalaDoc;
11.4 Contributing Documentation;
11.5 How to Add a New Recipe to This Cookbook;
11.6 Sharing Code in Modules;
Index;
Colophon;
Rubrieken
- advisering
- algemeen management
- coaching en trainen
- communicatie en media
- economie
- financieel management
- inkoop en logistiek
- internet en social media
- it-management / ict
- juridisch
- leiderschap
- marketing
- mens en maatschappij
- non-profit
- ondernemen
- organisatiekunde
- personal finance
- personeelsmanagement
- persoonlijke effectiviteit
- projectmanagement
- psychologie
- reclame en verkoop
- strategisch management
- verandermanagement
- werk en loopbaan