: Graeme Rocher, Jeff Scott Brown
: The Definitive Guide to Grails
: Apress
: 9781430208716
: 2
: CHF 38.00
:
: Allgemeines, Lexika
: English
: 648
: Wasserzeichen/DRM
: PC/MAC/eReader/Tablet
: PDF

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.

Gr eme Rocher, Grails lead and founder, andJeff 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 Edition2
Contents at a Glance5
Contents6
About the Authors17
About the Technical Reviewer19
Acknowledgments20
Introduction22
Who This Book Is For23
How This Book Is Structured24
Conventions24
Prerequisites24
Downloading the Code25
Contacting the Authors25
The Essence of Grails26
Simplicity and Power27
Grails, the Platform28
Living in the Java Ecosystem29
Getting Started30
Creating Your First Application32
Summary40
Getting Started with Grails41
What Is Scaffolding?41
Creating a Domain41
Dynamic Scaffolding43
Static Scaffolding51
Being Environmentally Friendly57
Configuring Data Sources58
Deploying the Application65
Summary66
Understanding Domain Classes68
Persisting Fields to the Database68
Validating Domain Classes69
Using Custom Validators72
Understanding Transient Properties73
Customizing Your Database Mapping74
Building Relationships76
Extending Classes with Inheritance79
Embedding Objects82
Testing Domain Classes83
Summary86
Understanding Controllers87
Defining Controllers87
Creating a Model97
Rendering a View98
Performing Data Binding99
Working with Command Objects104
Imposing HTTP Method Restrictions107
Controller IO108
Using Simple Interceptors112
Testing Controllers113
Controllers in Action115
Summary128
Understanding Views129
The Basics129
Built- in Grails Tags133
Grails Dynamic Tags138
Creating Custom Tags158
Summary163
Mapping URLs164
Understanding the Default URL Mapping164
Including Static Text in a URL Mapping165
Removing the Controller and Action Names from the URL166
Embedding Parameters in a Mapping166
Specifying Additional Parameters168
Mapping to a View169
Applying Constraints to URL Mappings170
Including Wildcards in a Mapping171
Mapping to HTTP Request Methods172
Mapping HTTP Response Codes174
Taking Advantage of Reverse URL Mapping175
Defining Multiple URL Mappings Classes176
Testing URL Mappings176
Summary179
Internationalization180
Localizing Messages180
Using Parameterized Messages185
Using messageSource189
Summary191
Ajax192
The Basics of Ajax192
Ajax in Action194
Changing Your Ajax Provider195
Asynchronous Form Submission196
Executing Code Before and After a Call198
Handling Events199