Simply Rails 2 Is a Comprehensive, Step-By-Step Guide to Building Powerful Web Applications Using Ruby on Rails

Total Page:16

File Type:pdf, Size:1020Kb

Simply Rails 2 Is a Comprehensive, Step-By-Step Guide to Building Powerful Web Applications Using Ruby on Rails 'REYSCALE #-9+ 0ANTONE ALL SOURCE CODE AVAILABLE FOR DOWNLOAD Black 50% CMYK O, 53, 100, 0 PANTONE Orange 021 0ANTONE C THE SIMPLE AND EASY WAY TO BUILDBlack 100% CMYK 100, 45, 0, 37 PANTONE 2955 C #-9+ BULLETPROOF WEB APPLICATIONS 'REYSCALE RAILS Updated to take advantage of all the new Rails 2 features, Simply Rails 2 is a comprehensive, step-by-step guide to building powerful web applications using Ruby On Rails. Perfect for the programming novice or someone looking to move into SIMPLY the agile Rails framework, this book will teach you how to build bulletproof Web 2.0 PANTONE Orange 021 C PANTONE 2955 C CMYK O, 53, 100, 0 CMYK 100, 45, 0, 37 applications from scratch, with more features using less code. Black 50% Black 100% Build and deploy your own Rails web application. “If you’re looking for RAILS your first Rails book, 2 Reap the benefits of using best-practice MVC architecture. this is a good choice” BY PATRICK LENZ Use Rails’s Ajax features to create slick interfaces. www.ibm.com Interact with databases easily using ActiveRecord. GARY POLLICE Add the magic of REST to your apps with Rails Resources. “The way this book is Use plugins to enhance your applications easily. laid out is first class” www.rubyinside.com SIMPLY RAILS SIMPLY PETER COOPER ABOUT PATRICK LENZ Patrick Lenz has been developing web applications for “Definitely a good more than ten years. Founder and lead developer of the introduction, especially freshmeat.net software portal, he and his Rails consultancy if you are new to Ruby.” and web application development company, limited weblog.jamisbuck.org overload, are responsible for numerous community driven JAMIS BUCK Patrick web applications developed using Ruby on Rails. SITEPOINT BOOKS WEB PROGRAMMING ISBN-13: 978-0-9804552-0-5 Advocate best practice techniques Lead you through practical examples Provide working code for your web site 2 Make learning easy and fun THE ULTIMATE BEGINNER’S GUIDE TO RUBY ON RAILS USD $39.95 CAD $39.95 Visit us on the Web at sitepoint.com or for sales and support email [email protected] LENZ simplyrails.indd 1 4/16/2008 11:00:53 AM Summary of Contents Preface . xix 1. Introducing Ruby on Rails . 1 2. Getting Started . 15 3. Introducing Ruby . 53 4. Rails Revealed . 93 5. Models, Views, and Controllers . 119 6. Helpers, Forms, and Layouts . 155 7. Ajax and Web 2.0 . 197 8. Protective Measures . 249 9. Advanced Topics . 303 10. Rails Plugins . 351 11. Debugging, Testing, and Benchmarking . 379 12. Deployment and Production Use . 425 Index . 449 SIMPLY RAILS 2 BY PATRICK LENZ SECOND EDITION iv Simply Rails 2 by Patrick Lenz Copyright © 2008 SitePoint Pty. Ltd. Expert Reviewer: Luke Redpath Editor: Hilary Reynolds Managing Editor: Simon Mackie Index Editor: Max McMaster Technical Editor: Andrew Tetlaw Cover Design: Alex Walker Technical Director: Kevin Yank Printing History: First Edition: January 2007 Second Edition: May 2008 Notice of Rights All rights reserved. No part of this book may be reproduced, stored in a retrieval system or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews. Notice of Liability The author and publisher have made every effort to ensure the accuracy of the information herein. However, the information contained in this book is sold without warranty, either express or implied. Neither the authors and SitePoint Pty. Ltd., nor its dealers or distributors will be held liable for any damages to be caused either directly or indirectly by the instructions contained in this book, or by the software or hardware products described herein. Trademark Notice Rather than indicating every occurrence of a trademarked name as such, this book uses the names only in an editorial fashion and to the benefit of the trademark owner with no intention of infringement of the trademark. Published by SitePoint Pty. Ltd. 48 Cambridge Street Collingwood VIC Australia 3066 Web: www.sitepoint.com Email: [email protected] ISBN 978-0-9804552-0-5 Printed and bound in the United States of America v About the Author Patrick Lenz has been developing web applications for more than ten years. Founder and lead developer of the freshmeat.net software portal, he and his Rails consultancy and web application development company, limited overload, are responsible for several community- driven web applications developed using Ruby on Rails. Patrick also authored some of the first articles to appear on the web about architecting and scaling larger Rails applications. Patrick lives in Wiesbaden, Germany, with his wife Alice and his daughter Gwendolyn. When not working in front of a computer, he can often be seen with a camera in his hand, either taking artsy pictures or documenting the progress of his baby girl conquering the world.1 He also enjoys cars, music, and extended weekend brunches with friends. His weblog can be found at http://poocs.net/. About the Expert Reviewer Luke Redpath is a programmer with over seven years’ experience in the web design and de­ velopment field. A recovering PHP and ASP developer, Luke has been using Ruby and Rails professionally for nearly two years and has released and contributed to several Ruby libraries and Rails plugins, including UJS—the Rails unobtrusive JavaScript plugin.2 He currently resides in North London with his long-term partner Julie. About the Technical Editor Andrew Tetlaw has been tinkering with web sites as a web developer since 1997 and has also worked as a high school English teacher, an English teacher in Japan, a window cleaner, a car washer, a kitchen hand, and a furniture salesman. At SitePoint he is dedicated to making the world a better place through the technical editing of SitePoint books and kits. He is also a busy father of five, enjoys coffee, and often neglects his blog at http://tetlaw.id.au/. About the Technical Director As Technical Director for SitePoint, Kevin Yank oversees all of its technical publica­ tions—books, articles, newsletters, and blogs. He has written over 50 articles for SitePoint, but is best known for his book, Build Your Own Database Driven Website Using PHP & 1 His pictures are regularly published to Flickr and are available at http://flickr.com/photos/scoop/ 2 http://www.ujs4rails.com/ vi MySQL. 3 Kevin lives in Melbourne, Australia, and enjoys performing improvised comedy theater and flying light aircraft. About SitePoint SitePoint specializes in publishing fun, practical, and easy-to-understand content for web professionals. Visit http://www.sitepoint.com/ to access our books, newsletters, articles, and community forums. 3 http://www.sitepoint.com/books/phpmysql1/ To my daughter Gwendolyn and my wife Alice. Table of Contents Preface . xix Who Should Read This Book? . xix What You’ll Learn . xx What’s in This Book? . xx The Book’s Web Site . xxii The Code Archive . xxii Updates and Errata . xxiii The SitePoint Forums . xxiii The SitePoint Newsletters . xxiii Your Feedback . xxiii Conventions Used in This Book . xxiv Code Samples . xxiv Tips, Notes, and Warnings . xxv Acknowledgments . xxv Chapter 1 Introducing Ruby on Rails . 1 History . 4 Development Principles . 5 Convention Over Configuration . 5 Don’t Repeat Yourself . 7 Agile Development . 8 Building the Example Web Application . 9 What Is Digg? . 10 Features of the Example Application . 12 Summary . 14 x Chapter 2 Getting Started . 15 What Does All This Cost? . 16 Installing on Windows . 17 Installing on Mac OS X . 19 Mac OS X 10.5 (Leopard) . 20 Mac OS X 10.4 (Tiger) and Earlier . 20 Installing on Linux . 31 Using a Package Manager . 32 Prerequisites . 32 Installing Ruby on Linux . 33 Installing RubyGems on Linux . 35 Installing Rails on Linux . 37 Installing SQLite on Linux . 38 Installing the SQLite Database Interface for Ruby . 39 Building a Foundation . 40 One Directory Structure to Rule Them All . 40 Creating the Standard Directory Structure . 41 Starting Our Application . 43 Which Text Editor? . 46 Windows Text Editors . 47 Mac OS X Text Editors . 48 Linux and Cross-platform Editors . 50 Summary . ..
Recommended publications
  • Resin 3.2 Reference
    Contents 1 Overview 3 1.1 Features - Resin and Resin Professional . .3 2 Installation 11 2.1 Resin Installation Quick Start . 11 2.2 Resin Installation . 16 2.3 Resin Web Server . 16 2.4 Resin with Apache . 22 2.5 Resin with IIS . 34 2.6 How the Plugins Dispatch to Resin . 44 3 Command-Line 47 3.1 Command-Line Configuration . 47 4 Admin Guide 51 4.1 User Guide: Administration . 51 5 Watchdog 63 5.1 Resin Watchdog . 63 6 Virtual Hosts 73 6.1 Virtual Hosting . 73 7 Clustering 89 7.1 Resin Clustering . 89 8 Web Applications 109 8.1 An Overview of Web Applications . 109 9 Logging 137 9.1 Log . 137 10 Administration 163 10.1 Resin Administration . 163 1 CONTENTS 11 Deployment 177 11.1 Packaging/Deployment . 177 12 Proxy Caching 181 12.1 Server Caching . 181 13 Quercus 193 13.1 Quercus: PHP in Java . 193 14 Security 217 14.1 Resin Security . 217 15 Inversion of Control 271 15.1 Resin IoC . 271 15.2 Scheduled Task . 308 16 Amber 327 16.1 Amber . 327 17 Embedding Resin 355 17.1 Embedding Resin . 355 18 Filters 367 18.1 Filters . 367 19 BAM 379 19.1 BAM . 379 20 Comet 405 20.1 Comet/Server-Push Servlet . 405 21 Remoting 411 21.1 Resin Remoting . 411 21.2 Hessian . 417 22 Messaging 423 22.1 Resin Messaging . 423 23 JSF - Java Server Faces 435 23.1 JSF - Java Server Faces . 435 24 Configuration Tags 445 24.1 cluster: Cluster tag configuration .
    [Show full text]
  • Rubabel: Wrapping Open Babel with Ruby Rob Smith1*, Ryan Williamson1, Dan Ventura1 and John T Prince2*
    Smith et al. Journal of Cheminformatics 2013, 5:35 http://www.jcheminf.com/content/5/1/35 SOFTWARE Open Access Rubabel: wrapping open Babel with Ruby Rob Smith1*, Ryan Williamson1, Dan Ventura1 and John T Prince2* Abstract Background: The number and diversity of wrappers for chemoinformatic toolkits suggests the diverse needs of the chemoinformatic community. While existing chemoinformatics libraries provide a broad range of utilities, many chemoinformaticians find compiled language libraries intimidating, time-consuming, arcane, and verbose. Although high-level language wrappers have been implemented, more can be done to leverage the intuitiveness of object-orientation, the paradigms of high-level languages, and the extensibility of languages such as Ruby. We introduce Rubabel, an intuitive, object-oriented suite of functionality that substantially increases the accessibily of the tools in the Open Babel chemoinformatics library. Results: Rubabel requires fewer lines of code than any other actively developed wrapper, providing better object organization and navigation, and more intuitive object behavior than extant solutions. Moreover, Rubabel provides a convenient interface to the many extensions currently available in Ruby, greatly streamlining otherwise onerous tasks such as creating web applications that serve up Rubabel functionality. Conclusions: Rubabel is powerful, intuitive, concise, freely available, cross-platform, and easy to install. We expect it to be a platform of choice for new users, Ruby users, and some users of current solutions. Keywords: Chemoinformatics, Open Babel, Ruby Background tasks. Though it allows the user to access the functionality Despite the fact that chemoinformatics tools have been of the component libraries from one Python script, Cin- developed since the late 1990s [1], the field has yet to fony does not automatically manage underlying data types rally in support of a single library.
    [Show full text]
  • TRANSPORT LAYER SECURITY (TLS) Lokesh Phani Bodavula
    TRANSPORT LAYER SECURITY (TLS) Lokesh Phani Bodavula October 2015 Abstract 1 Introduction The security of Electronic commerce is completely in the hands of Cryptogra- phy. Most of the transactions through e-commerce sites, auction sites, on-line banking, stock trading and many more are exchanged over the network. SSL or TLS are the additional layers that are required in order to obtain authen- tication, privacy and integrity for all kinds of communication going through network. This paper focuses on the additional layer (TLS) which is responsi- ble for the whole communication. Transport Layer Security is a protocol that is responsible for offering privacy between the communicating applications and their users on Internet. TLS is inserted between the application layer and the network layer-where the session layer is in the OSI model TLS, however, requires a reliable transport channel-typically TCP. 2 History Instead of the end-to-end argument and the S-HTTP proposal the developers at Netscape Communications introduced an interesting secured connection concept of low-layer and high-layer security. For achieving this type of security there em- ployed a new intermediate layer between the transport layer and the application layer which is called as Secure Sockets Layer (SSL). SSL is the starting stage for the evolution of different transport layer security protocols. Technically SSL protocol is assigned to the transport layer because of its functionality is deeply inter-winded with the one of a transport layer protocol like TCP. Coming to history of Transport layer protocols as soon as the National Center for Super- computing Application (NCSA) released the first popular Web browser called Mosaic 1.0 in 1993, Netscape Communications started working on SSL protocol.
    [Show full text]
  • Enhanced Virtual Hosting Avi Networks — Technical Reference (20.1)
    Page 1 of 9 Enhanced Virtual Hosting Avi Networks — Technical Reference (20.1) Enhanced Virtual Hosting view online Overview This guide explains the usage of enhanced virtual hosting (EVH). This will help in enabling the virtual hosting on virtual service irrespective of SNI. Virtual service can be of two main types, namely, * Non-virtual hosting enabled virtual service * Virtual hosting enabled virtual service Non-Virtual Hosting enabled Virtual Service If you uncheck Virtual Hosting VS checkbox, in Virtual Service window, then that particular virtual service would be non- virtual hosting enabled virtual service. Virtual Hosting enabled Virtual Service SNI Virtual Hosting Virtual service have a configuration option to enable virtual hosting support. Enabling this option within a virtual service indicates the virtual service is a parent or child of another service, in a server name indication (SNI) deployment. Server Name Indication, or SNI, is a method of virtual hosting multiple domain names for an SSL enabled virtual IP. For more details on virtual hosting enabled virtual service, refer to Server Name Indication, Wildcard SNI Matching for Virtual Hosting user guides. Enhanced Virtual Hosting Virtual service have a configuration option to enable virtual hosting support. Enabling this option within a virtual service indicates the virtual service is a parent or child of another service. If the type of a virtual service is either parent or child, it is considered a virtual hosting enabled virtual service. Copyright © 2021 Avi Networks, Inc. Page 2 of 9 Enhanced Virtual Hosting Avi Networks — Technical Reference (20.1) The virtual service placement for EVH service follow the same conditions as SNI parent child.
    [Show full text]
  • Hbase: the Definitive Guide
    HBase: The Definitive Guide HBase: The Definitive Guide Lars George Beijing • Cambridge • Farnham • Köln • Sebastopol • Tokyo HBase: The Definitive Guide by Lars George Copyright © 2011 Lars George. All rights reserved. Printed in the United States of America. Published by O’Reilly Media, Inc., 1005 Gravenstein Highway North, Sebastopol, CA 95472. O’Reilly books may be purchased for educational, business, or sales promotional use. Online editions are also available for most titles (http://my.safaribooksonline.com). For more information, contact our corporate/institutional sales department: (800) 998-9938 or [email protected]. Editors: Mike Loukides and Julie Steele Indexer: Angela Howard Production Editor: Jasmine Perez Cover Designer: Karen Montgomery Copyeditor: Audrey Doyle Interior Designer: David Futato Proofreader: Jasmine Perez Illustrator: Robert Romano Printing History: September 2011: First Edition. Nutshell Handbook, the Nutshell Handbook logo, and the O’Reilly logo are registered trademarks of O’Reilly Media, Inc. HBase: The Definitive Guide, the image of a Clydesdale horse, and related trade dress are trademarks of O’Reilly Media, Inc. Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this book, and O’Reilly Media, Inc., was aware of a trademark claim, the designations have been printed in caps or initial caps. While every precaution has been taken in the preparation of this book, the publisher and author assume no responsibility for errors or omissions, or for damages resulting from the use of the information con- tained herein. ISBN: 978-1-449-39610-7 [LSI] 1314323116 For my wife Katja, my daughter Laura, and son Leon.
    [Show full text]
  • Specialising Dynamic Techniques for Implementing the Ruby Programming Language
    SPECIALISING DYNAMIC TECHNIQUES FOR IMPLEMENTING THE RUBY PROGRAMMING LANGUAGE A thesis submitted to the University of Manchester for the degree of Doctor of Philosophy in the Faculty of Engineering and Physical Sciences 2015 By Chris Seaton School of Computer Science This published copy of the thesis contains a couple of minor typographical corrections from the version deposited in the University of Manchester Library. [email protected] chrisseaton.com/phd 2 Contents List of Listings7 List of Tables9 List of Figures 11 Abstract 15 Declaration 17 Copyright 19 Acknowledgements 21 1 Introduction 23 1.1 Dynamic Programming Languages.................. 23 1.2 Idiomatic Ruby............................ 25 1.3 Research Questions.......................... 27 1.4 Implementation Work......................... 27 1.5 Contributions............................. 28 1.6 Publications.............................. 29 1.7 Thesis Structure............................ 31 2 Characteristics of Dynamic Languages 35 2.1 Ruby.................................. 35 2.2 Ruby on Rails............................. 36 2.3 Case Study: Idiomatic Ruby..................... 37 2.4 Summary............................... 49 3 3 Implementation of Dynamic Languages 51 3.1 Foundational Techniques....................... 51 3.2 Applied Techniques.......................... 59 3.3 Implementations of Ruby....................... 65 3.4 Parallelism and Concurrency..................... 72 3.5 Summary............................... 73 4 Evaluation Methodology 75 4.1 Evaluation Philosophy
    [Show full text]
  • Ruby Programming Certification
    Ruby Programming Certification Duration: 5 Days What is the course about? This course will introduce the fundamentals concepts for the Ruby programming language. Ruby is an easy programming language to learn. Its popularly used by startups in developing web applications and for administering systems. Ruby was developed to make programmers happy and is popularly knwon for the Rails web application framework. Ruby is also the language used for developing Puppet, a systems automation software and MetaSploit, a security assesment framework.This course is designed for both programmers and developers who want to get the fundamentals of programming in Ruby. Duration The course is full time and runs over 5 days. This course is primarily offered as a private course to a team, group or a company. Programming Experience This is a beginner's course and no prior programming experience is required. A good command of computer skills, the command line or the terminal is required. Technical Skill We primarily use Linux or Mac during the course. A Windows machine can also be used but some things might not work. So, technical knowledge on the Linux environment is required. Private Training This course is primarily offered as a private course. A minimum of 4 delegates is required to schedule the course. The course can be run on your premises or our premises. When run on your premises, the course costs R9 500 per delegate with a minimum of 4 delegates to schedule the course. The cost is R12 500 to run the course on our premises and training can be done in eitherJohannesburg, Durban or Cape Town.
    [Show full text]
  • SSL EVERYWHERE Application and Web Security, Many Websites Still Have Weak Best Practices for Improving Enterprise Security Implementations of SSL/TLS
    SOLUTION BRIEF CHALLENGES • Even with recent focus on SSL EVERYWHERE application and web security, many websites still have weak Best Practices for improving enterprise security implementations of SSL/TLS. without impacting performance • Main reasons for weak SSL Although increased attention has been focused on application and web security implementations include lack recently, many websites still have weak implementations of Secure Socket Layer of infrastructure and browser (SSL) / Transport Layer Security (TLS). Lack of infrastructure and browser support, support, performance penalty, and performance penalty, and implementation complexity have been the primary implementation complexity. reasons for the dearth of stronger SSL implementations. However, with recent • Legacy hardware load balancers advances in the SSL protocol, as well as significant performance improvements of cannot scale elastically, and are SSL on commodity x86 platforms, stronger SSL can be – and should be – everywhere. capped at speeds that are punitively Avi Networks Application Delivery Controller (ADC) natively supports these new tied to acquisition costs. capabilities to maximize application security without sacrificing performance. SOLUTION • The Avi Vantage Platform natively NEW ACRONYMS IN THE WORLD OF SSL implements server name indication Server Name Indication (SNI) (SNI) infrastructure, HTTP Strict Virtual hosting with SSL is a chicken-and-egg problem. The client sends an SSL Transport Security (HSTS), RSA and Hello, and the server must send back the SSL public key. If there are multiple Elliptic Curve Cryptography (ECC) domain names attached to the same IP address, a client that supports Server Name certificates, and Perfect Forward Indication (SNI) sends the hello along with the requested domain name. The server Secrecy (PFS) with point-and-click can now send back the proper SSL response.
    [Show full text]
  • An Introduction to Ruby and Rails
    An Introduction to Ruby and Rails This paper was originally presented at the Southwest Fox conference in Gilbert, Arizona in October, 2010. http://www.swfox.net An Introduction to Ruby and Rails Rick Borup Information Technology Associates 701 Devonshire Dr, Suite 127 Champaign, IL 61820 Voice: (217) 359-0918 Fax: (217) 398-0413 Email: [email protected] Ruby is a powerful, object-oriented, open-source language with a clean and easily understandable syntax. Originally released to the public in 1995, wide-spread interest in the Ruby language really began to take off in 2003 with the release of the Ruby on Rails® framework. Also known as "RoR" or simply "Rails", Ruby on Rails is an open-source Web framework that makes it possible to quickly and easily create data-based Web applications. Together, the Ruby language and the Ruby on Rails framework can become an exciting and powerful addition to any developer's toolbox. This session introduces both the Ruby language and the Rails framework, focusing on their installation and use on a Windows® platform with a perspective geared toward experienced Visual FoxPro® developers. © 2010 Rick Borup Page 1 of 64 An Introduction to Ruby and Rails Table of Contents Introduction............................................................................................................................................................ 4 Installing Ruby and Rails on Windows......................................................................................................... 4 Installing Instant Rails
    [Show full text]
  • Writing and Running Ruby Programs 1
    The Ruby Workshop A New, Interactive Approach to Learning Ruby Akshat Paul Peter Philips Dániel Szabó Cheyne Wallace The Ruby Workshop Copyright © 2019 Packt Publishing All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews. Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the authors, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book. Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information. Authors: Akshat Paul, Peter Philips, Dániel Szabó, and Cheyne Wallace Technical Reviewers: Jonathan Evans, Jagdish Narayandasani, and Dixitkumar N. Patel Managing Editor: Snehal Tambe Acquisitions Editor: Alicia Wooding Production Editor: Samita Warang Editorial Board: Shubhopriya Banerjee, Bharat Botle, Ewan Buckingham, Megan Carlisle, Mahesh Dhyani, Manasa Kumar, Alex Mazonowicz, Bridget Neale, Dominic Pereira, Shiny Poojary, Abhishek Rane, Erol Staveley, Ankita Thakur, Nitesh Thakur, and Jonathan Wray First Published: October 2019 Production Reference: 2201119 ISBN: 978-1-83864-236-5 Published by Packt Publishing Ltd. Livery Place, 35 Livery Street Birmingham B3 2PB, UK Table of Contents Preface i Chapter 1: Writing and Running Ruby Programs 1 Introduction ...................................................................................................
    [Show full text]
  • Client-Server Web Apps with Javascript and Java
    Client-Server Web Apps with JavaScript and Java Casimir Saternos Client-Server Web Apps with JavaScript and Java by Casimir Saternos Copyright © 2014 EzGraphs, LLC. All rights reserved. Printed in the United States of America. Published by O’Reilly Media, Inc., 1005 Gravenstein Highway North, Sebastopol, CA 95472. O’Reilly books may be purchased for educational, business, or sales promotional use. Online editions are also available for most titles (http://my.safaribooksonline.com). For more information, contact our corporate/ institutional sales department: 800-998-9938 or [email protected]. Editors: Simon St. Laurent and Allyson MacDonald Indexer: Judith McConville Production Editor: Kristen Brown Cover Designer: Karen Montgomery Copyeditor: Gillian McGarvey Interior Designer: David Futato Proofreader: Amanda Kersey Illustrator: Rebecca Demarest April 2014: First Edition Revision History for the First Edition: 2014-03-27: First release See http://oreilly.com/catalog/errata.csp?isbn=9781449369330 for release details. Nutshell Handbook, the Nutshell Handbook logo, and the O’Reilly logo are registered trademarks of O’Reilly Media, Inc. Client-Server Web Apps with JavaScript and Java, the image of a large Indian civet, and related trade dress are trademarks of O’Reilly Media, Inc. Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this book, and O’Reilly Media, Inc. was aware of a trademark claim, the designations have been printed in caps or initial caps. While every precaution has been taken in the preparation of this book, the publisher and author assume no responsibility for errors or omissions, or for damages resulting from the use of the information contained herein.
    [Show full text]
  • Hypertext Transfer Protocol Is Used Between the Browser and a Web Server
    HHTTTTPP BByy BBaarrddiiaa ,, PPaattiitt,, aanndd RRoozzhheehh HTTP - Introduction - Hyper Text Transfer Protocol -uses the TCP/IP technology -has had the most impact on the World Wide Web (WWW) - specs in RFC 2616 (RFC2616) HTTP - Importance of The Web • - before HTTP , FTP data transfers accounted for approximately 1/3 of the Internet traffic • - HTTP inception in 1990s and by 2000 Web traffic completely overshadowed other applications HTTP - Importance of The Web (continued) • - companies have web sites, online catalogs • - Internet and Web are indistinguishable for most users • - Uses of the Web include Graphical Design of Information, Dissemination of Research http://info. cern.ch/ (world’s first-ever web server) European organization for Nuclear Research, browsing and ordering of products, client and customer support, display of create arts HTTP - Architectural Components • - Web consists of large set of documents called Web Pages • - web pages considered hypermedia document • - media suffix used to indicate that document contains items other then text , such as graphics • - hyper prefix used to indicate document can contain selectable links • - Hyper Text Markup Language (HTML) used to present mixture of text and images HTTP - Sample HTML Page • <HTML> • <HEAD> • <TITLE>MyPage.html - My Home Page</TITLE> • <SCRIPT></SCRIPT> • </HEAD> • <BODY> • Welcome to My Home Page • </BODY> </HTML> HTTP - Sample HTML Page HTTP - Uniform Resource Locator (URL) • - each page assigned a unique URL name that is used to identify it http://hostname[:port]/path[;parameters][[?query]
    [Show full text]