The Definitive Guide to Grails (eBook)

eBook Download: PDF
2009 | 2nd ed.
648 Seiten
Apress (Verlag)
978-1-4302-0871-6 (ISBN)

Lese- und Medienproben

The Definitive Guide to Grails - Graeme Rocher, Jeff Scott Brown
Systemvoraussetzungen
42,79 inkl. MwSt
  • Download sofort lieferbar
  • Zahlungsarten anzeigen

The rise of Ruby on Rails has signified a huge shift in how we build web applications today; it is a fantastic framework with a growing community. There is, however, space for another such framework that integrates seamlessly with Java. Thousands of companies have invested in Java, and these same companies are losing out on the benefits of a Rails-like framework. Enter Grails.

Grails is not just a Rails clone. It aims to provide a Rails-like environment that is more familiar to Java developers and employs idioms that Java developers are comfortable using, making the adjustment in mentality to a dynamic framework less of a jump. The concepts within Grails, like interceptors, tag libs, and Groovy Server Pages (GSP), make those in the Java community feel right at home.

Grails' foundation is on solid open source technologies such as Spring, Hibernate, and SiteMesh, which gives it even more potential in the Java space: Spring provides powerful inversion of control and MVC, Hibernate brings a stable, mature object relational mapping technology with the ability to integrate with legacy systems, and SiteMesh handles flexible layout control and page decoration.

Grails complements these with additional features that take advantage of the coding-by-convention paradigm such as dynamic tag libraries, Grails object relational mapping, Groovy Server Pages, and scaffolding.

Graeme Rocher, Grails lead and founder, and Jeff Brown bring you completely up-to-date with their authoritative and fully comprehensive guide to the Grails framework. You'll get to know all the core features, services, and Grails extensions via plug-ins, and understand the roles that Groovy and Grails are playing in the changing Web.



Graeme Rocher is an experienced software engineer, consultant and dynamic language expert. Graeme is project lead of the open source Grails web application framework (Grails.org) and author of The Definitive Guide to Grails. In Graeme's role as head of Grails development at SpringSource, the professional open source services company behind the Spring framework, Graeme leads the development of the Grails web framework and provides consulting, training and support to SpringSource's clients. Graeme is a frequent speaker at industry conferences on subjects related to Groovy, Grails and dynamic languages in Java. Prior to joining SpringSource Graeme co-founded G2One the Groovy/Grails Company which was later acquired by SpringSource.
The rise of Ruby on Rails has signified a huge shift in how we build web applications today; it is a fantastic framework with a growing community. There is, however, space for another such framework that integrates seamlessly with Java. Thousands of companies have invested in Java, and these same companies are losing out on the benefits of a Rails-like framework. Enter Grails.Grails is not just a Rails clone. It aims to provide a Rails like environment that is more familiar to Java developers and employs idioms that Java developers are comfortable using, making the adjustment in mentality to a dynamic framework less of a jump. The concepts within Grails, like interceptors, tag libs, and Groovy Server Pages (GSP), make those in the Java community feel right at home.Grails' foundation is on solid open source technologies such as Spring, Hibernate, and SiteMesh, which gives it even more potential in the Java space: Spring provides powerful inversion of control and MVC, Hibernate brings a stable, mature object relational mapping technology with the ability to integrate with legacy systems, and SiteMesh handles flexible layout control and page decoration.Grails complements these with additional features that take advantage of the coding by convention paradigm such as dynamic tag libraries, Grails object relational mapping, Groovy Server Pages, and scaffolding.Graeme Rocher, Grails lead and founder, and Jeff Brown bring you completely up to date with their authoritative and fully comprehensive guide to the Grails framework. You'll get to know all the core features, services, and Grails extensions via plug ins, and understand the roles that Groovy and Grails are playing in the changing Web.

Graeme Rocher is an experienced software engineer, consultant and dynamic language expert. Graeme is project lead of the open source Grails web application framework (Grails.org) and author of The Definitive Guide to Grails. In Graeme's role as head of Grails development at SpringSource, the professional open source services company behind the Spring framework, Graeme leads the development of the Grails web framework and provides consulting, training and support to SpringSource's clients. Graeme is a frequent speaker at industry conferences on subjects related to Groovy, Grails and dynamic languages in Java. Prior to joining SpringSource Graeme co-founded G2One the Groovy/Grails Company which was later acquired by SpringSource.

Second Edition 2
Contents at a Glance 5
Contents 6
About the Authors 17
About the Technical Reviewer 19
Acknowledgments 20
Introduction 22
Who This Book Is For 23
How This Book Is Structured 24
Conventions 24
Prerequisites 24
Downloading the Code 25
Contacting the Authors 25
The Essence of Grails 26
Simplicity and Power 27
Grails, the Platform 28
Living in the Java Ecosystem 29
Getting Started 30
Creating Your First Application 32
Summary 40
Getting Started with Grails 41
What Is Scaffolding? 41
Creating a Domain 41
Dynamic Scaffolding 43
Static Scaffolding 51
Being Environmentally Friendly 57
Configuring Data Sources 58
Deploying the Application 65
Summary 66
Understanding Domain Classes 68
Persisting Fields to the Database 68
Validating Domain Classes 69
Using Custom Validators 72
Understanding Transient Properties 73
Customizing Your Database Mapping 74
Building Relationships 76
Extending Classes with Inheritance 79
Embedding Objects 82
Testing Domain Classes 83
Summary 86
Understanding Controllers 87
Defining Controllers 87
Creating a Model 97
Rendering a View 98
Performing Data Binding 99
Working with Command Objects 104
Imposing HTTP Method Restrictions 107
Controller IO 108
Using Simple Interceptors 112
Testing Controllers 113
Controllers in Action 115
Summary 128
Understanding Views 129
The Basics 129
Built- in Grails Tags 133
Grails Dynamic Tags 138
Creating Custom Tags 158
Summary 163
Mapping URLs 164
Understanding the Default URL Mapping 164
Including Static Text in a URL Mapping 165
Removing the Controller and Action Names from the URL 166
Embedding Parameters in a Mapping 166
Specifying Additional Parameters 168
Mapping to a View 169
Applying Constraints to URL Mappings 170
Including Wildcards in a Mapping 171
Mapping to HTTP Request Methods 172
Mapping HTTP Response Codes 174
Taking Advantage of Reverse URL Mapping 175
Defining Multiple URL Mappings Classes 176
Testing URL Mappings 176
Summary 179
Internationalization 180
Localizing Messages 180
Using Parameterized Messages 185
Using messageSource 189
Summary 191
Ajax 192
The Basics of Ajax 192
Ajax in Action 194
Changing Your Ajax Provider 195
Asynchronous Form Submission 196
Executing Code Before and After a Call 198
Handling Events 199
Fun with Ajax Remote Linking 200
Adding Effects and Animation 214
Ajax- Enabled Form Fields 214
A Note on Ajax and Performance 218
Summary 219
Creating Web Flows 220
Getting Started with Flows 221
Flows in Action 229
Summary 268
GORM 269
Persistence Basics 269
Associations 272
Querying 274
Configuring GORM 283
The Semantics of GORM 285
Transactions in GORM 292
Detached Objects 294
Performance Tuning GORM 298
Locking Strategies 305
Events Auto Time Stamping 307
Summary 308
Services 309
Service Basics 309
Services and Dependency Injection 311
Services in Action 311
Transactions 315
Scoping Services 317
Testing Services 318
Exposing Services 318
Summary 324
Integrating Grails 325
Grails and Configuration 325
Understanding Grails’ Build System 330
Integration with Apache Ant 345
Dependency Resolution with Ivy 347
Code Coverage with Cobertura 350
Continuous Integration with Hudson 351
Adding Support to Your Favorite IDE 355
Integration with E- mail Servers 365
Scheduling Jobs 369
Deployment 381
Summary 385
Plugins 386
Plugin Basics 386
Plugins in Action 410
Summary 425
Security 426
Securing Against Attacks 426
Using Dynamic Codecs 433
Authentication and Authorization 435
Grails Filters 436
The JSecurity Plugin 438
Limiting Access Through URL Mappings 465
Summary 467
Web Services 468
REST 469
Atom and RSS 492
SOAP 497
Summary 504
Leveraging Spring 505
Spring Basics 505
Spring and Grails 507
Spring in Action 516
Summary 534
Legacy Integration with Hibernate 536
Legacy Mapping with the ORM DSL 536
Mapping with Hibernate XML 549
Summary 560
The Groovy Language 561
Groovy and Java: A Comparison 561
The Basics 563
Groovy Power Features 573
Summary 585
Index 586

Erscheint lt. Verlag 19.2.2009
Zusatzinfo 648 p.
Verlagsort Berkeley
Sprache englisch
Themenwelt Informatik Programmiersprachen / -werkzeuge Java
Mathematik / Informatik Informatik Web / Internet
Schlagworte AJAX • Framework • Grails • Java • Open Source • Ruby On Rails • web applications • Web Services
ISBN-10 1-4302-0871-6 / 1430208716
ISBN-13 978-1-4302-0871-6 / 9781430208716
Haben Sie eine Frage zum Produkt?
PDFPDF (Wasserzeichen)
Größe: 6,1 MB

DRM: Digitales Wasserzeichen
Dieses eBook enthält ein digitales Wasser­zeichen und ist damit für Sie persona­lisiert. Bei einer missbräuch­lichen Weiter­gabe des eBooks an Dritte ist eine Rück­ver­folgung an die Quelle möglich.

Dateiformat: PDF (Portable Document Format)
Mit einem festen Seiten­layout eignet sich die PDF besonders für Fach­bücher mit Spalten, Tabellen und Abbild­ungen. Eine PDF kann auf fast allen Geräten ange­zeigt werden, ist aber für kleine Displays (Smart­phone, eReader) nur einge­schränkt geeignet.

Systemvoraussetzungen:
PC/Mac: Mit einem PC oder Mac können Sie dieses eBook lesen. Sie benötigen dafür einen PDF-Viewer - z.B. den Adobe Reader oder Adobe Digital Editions.
eReader: Dieses eBook kann mit (fast) allen eBook-Readern gelesen werden. Mit dem amazon-Kindle ist es aber nicht kompatibel.
Smartphone/Tablet: Egal ob Apple oder Android, dieses eBook können Sie lesen. Sie benötigen dafür einen PDF-Viewer - z.B. die kostenlose Adobe Digital Editions-App.

Zusätzliches Feature: Online Lesen
Dieses eBook können Sie zusätzlich zum Download auch online im Webbrowser lesen.

Buying eBooks from abroad
For tax law reasons we can sell eBooks just within Germany and Switzerland. Regrettably we cannot fulfill eBook-orders from other countries.

Mehr entdecken
aus dem Bereich
Einführung, Ausbildung, Praxis

von Christian Ullenboom

eBook Download (2023)
Rheinwerk Computing (Verlag)
37,43
Moderne GUIs für RIAs und Java-Applikationen

von Ralph Steyer

eBook Download (2022)
Springer Fachmedien Wiesbaden (Verlag)
42,99