Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

Share this Page URL

Chapter 4. Customers, auctions, and bidding > Displaying auctions - Pg. 66

66 C HAPTER 4 Customers, auctions, and bidding 4.2 Displaying auctions Now we're coming to the really interesting part of the application: displaying auctions and allowing customers to bid on them. In order to display auctions, we'll be touching on several Lift features: The rewriting mechanism for providing friendly URL s Built-in AJAX support JavaScript abstraction Comet support You might have noticed that when you click the link in the auction lists, you see the 404 page. This is because Lift doesn't know what to do with the /auction/1234 URL . Unsurprisingly, no template exists for each of the auctions, so to map this URL pattern to a known template, you need to implement Lift's rewriting mechanism. Rewriting is helpful for a variety of tasks, but it comes in particularly useful when prettifying dynamic URL s. 4.2.1 Auction detail URLs In the booking application, each auction will have a URL based on the ID defined for that row in the database. The URL could be anything you want, but in this case we'll just use the ID column to ensure that the URL is unique. This will give you URL s that