<s>
Grails	B-Language
is	O
an	O
open	B-Application
source	I-Application
web	B-Application
application	I-Application
framework	I-Application
that	O
uses	O
the	O
Apache	B-Application
Groovy	I-Application
programming	O
language	O
(	O
which	O
is	O
in	O
turn	O
based	O
on	O
the	O
Java	O
platform	O
)	O
.	O
</s>
<s>
It	O
is	O
intended	O
to	O
be	O
a	O
high-productivity	O
framework	O
by	O
following	O
the	O
"	O
coding	B-Application
by	I-Application
convention	I-Application
"	O
paradigm	O
,	O
providing	O
a	O
stand-alone	O
development	O
environment	O
and	O
hiding	O
much	O
of	O
the	O
configuration	O
detail	O
from	O
the	O
developer	O
.	O
</s>
<s>
Grails	B-Language
was	O
previously	O
known	O
as	O
"	O
Groovy	B-Language
on	I-Language
Rails	I-Language
"	O
;	O
in	O
March	O
2006	O
that	O
name	O
was	O
dropped	O
in	O
response	O
to	O
a	O
request	O
by	O
David	O
Heinemeier	O
Hansson	O
,	O
founder	O
of	O
the	O
Ruby	B-Application
on	I-Application
Rails	I-Application
framework	O
.	O
</s>
<s>
Grails	B-Language
was	O
developed	O
to	O
address	O
a	O
number	O
of	O
goals	O
:	O
</s>
<s>
Provide	O
a	O
web	B-Application
framework	I-Application
for	O
the	O
Java	O
platform	O
.	O
</s>
<s>
The	O
Persistence	B-Application
framework	O
.	O
</s>
<s>
Templates	O
using	O
GSP	O
(	O
Groovy	B-Application
Server	O
Pages	O
)	O
.	O
</s>
<s>
Customizable	O
and	O
extensible	O
Ajax	B-General_Concept
support	O
.	O
</s>
<s>
Grails	B-Language
has	O
three	O
properties	O
that	O
differentiate	O
it	O
from	O
traditional	O
Java	O
web	B-Application
frameworks	I-Application
:	O
</s>
<s>
This	O
configuration	O
is	O
very	O
often	O
externalized	O
in	O
XML	B-Protocol
files	O
to	O
ease	O
configuration	O
and	O
avoid	O
embedding	O
configuration	O
in	O
application	O
code	O
.	O
</s>
<s>
XML	B-Protocol
was	O
initially	O
welcomed	O
as	O
it	O
provided	O
greater	O
consistency	O
to	O
configure	O
applications	O
.	O
</s>
<s>
However	O
,	O
in	O
recent	O
years	O
,	O
it	O
has	O
become	O
apparent	O
that	O
although	O
XML	B-Protocol
is	O
great	O
for	O
configuration	O
,	O
it	O
can	O
be	O
tedious	O
to	O
set	O
up	O
an	O
environment	O
.	O
</s>
<s>
Adding	O
or	O
changing	O
functionality	O
in	O
applications	O
that	O
use	O
XML	B-Protocol
configuration	O
adds	O
an	O
extra	O
step	O
to	O
the	O
change	O
process	O
,	O
which	O
slows	O
down	O
productivity	O
and	O
may	O
diminish	O
the	O
agility	O
of	O
the	O
entire	O
process	O
.	O
</s>
<s>
Grails	B-Language
removes	O
the	O
need	O
to	O
add	O
configuration	O
in	O
XML	B-Protocol
files	O
.	O
</s>
<s>
Instead	O
,	O
the	O
framework	O
uses	O
a	O
set	O
of	O
rules	O
or	O
conventions	O
while	O
inspecting	O
the	O
code	O
of	O
Grails-based	O
applications	O
.	O
</s>
<s>
Grails	B-Language
provides	O
a	O
development	O
environment	O
that	O
includes	O
a	O
web	O
server	O
to	O
get	O
developers	O
started	O
right	O
away	O
.	O
</s>
<s>
All	O
required	O
libraries	O
are	O
part	O
of	O
the	O
Grails	B-Language
distribution	O
,	O
and	O
Grails	B-Language
prepares	O
the	O
Java	O
web	O
environment	O
for	O
deployment	O
automatically	O
.	O
</s>
<s>
Grails	B-Language
features	O
dynamic	O
methods	O
on	O
several	O
classes	O
through	O
mixins	B-Language
.	O
</s>
<s>
A	O
mixin	B-Language
is	O
a	O
method	O
that	O
is	O
added	O
to	O
a	O
class	O
dynamically	O
,	O
as	O
if	O
the	O
functionality	O
had	O
been	O
compiled	O
into	O
the	O
program	O
.	O
</s>
<s>
Grails	B-Language
provides	O
dynamic	O
methods	O
based	O
on	O
the	O
type	O
of	O
class	O
.	O
</s>
<s>
The	O
Grails	B-Language
web	B-Application
framework	I-Application
has	O
been	O
designed	O
according	O
to	O
the	O
MVC	O
paradigm	O
.	O
</s>
<s>
Grails	B-Language
uses	O
controllers	O
to	O
implement	O
the	O
behavior	O
of	O
web	O
pages	O
.	O
</s>
<s>
To	O
create	O
this	O
controller	O
the	O
grails	B-Language
command	O
is	O
used	O
,	O
as	O
shown	O
below	O
:	O
</s>
<s>
This	O
command	O
creates	O
a	O
class	O
in	O
the	O
grails-app/controller	O
directory	O
of	O
the	O
Grails	B-Language
project	O
.	O
</s>
<s>
Creating	O
the	O
controller	O
class	O
is	O
sufficient	O
to	O
have	O
it	O
recognized	O
by	O
Grails	B-Language
.	O
</s>
<s>
Grails	B-Language
supports	O
JSP	B-Language
and	O
GSP	O
.	O
</s>
<s>
This	O
view	O
should	O
be	O
saved	O
as	O
grails-app/views/book/list.gsp	O
of	O
the	O
Grails	B-Language
project	O
.	O
</s>
<s>
Placing	O
the	O
file	O
in	O
this	O
location	O
is	O
sufficient	O
to	O
have	O
it	O
recognized	O
by	O
Grails	B-Language
.	O
</s>
<s>
Grails	B-Language
provides	O
a	O
large	O
number	O
of	O
tag	O
libraries	O
out	O
of	O
the	O
box	O
.	O
</s>
<s>
This	O
tag	O
library	O
should	O
be	O
added	O
to	O
the	O
grails-app/taglib/ApplicationTagLib.groovy	O
file	O
or	O
a	O
file	O
ending	O
with	O
TagLib.groovy	O
in	O
the	O
grails-app/taglib	O
directory	O
.	O
</s>
<s>
Dynamic	O
tag	O
libraries	O
can	O
also	O
be	O
used	O
in	O
JSP	B-Language
files	I-Language
although	O
this	O
requires	O
a	O
little	O
more	O
work	O
.	O
</s>
<s>
The	O
domain	O
model	O
in	O
Grails	B-Language
is	O
persisted	O
to	O
the	O
database	O
using	O
(	O
Grails	B-Language
Object	B-General_Concept
Relational	I-General_Concept
Mapping	I-General_Concept
)	O
.	O
</s>
<s>
Domain	O
classes	O
are	O
saved	O
in	O
the	O
grails-app/domain	O
directory	O
and	O
can	O
be	O
created	O
using	O
the	O
grails	B-Language
command	O
as	O
shown	O
below	O
:	O
</s>
<s>
Creating	O
this	O
class	O
is	O
all	O
that	O
is	O
required	O
to	O
have	O
it	O
managed	O
for	O
persistence	B-Application
by	O
Grails	B-Language
.	O
</s>
<s>
With	O
Grails	B-Language
0.3	O
,	O
GORM	O
has	O
been	O
improved	O
and	O
e.g.	O
</s>
<s>
Note	O
that	O
the	O
query	O
syntax	O
is	O
Hibernate	B-Library
HQL	O
.	O
</s>
<s>
Grails	B-Language
supports	O
scaffolding	O
to	O
support	O
CRUD	B-General_Concept
operations	O
(	O
Create	O
,	O
Read	O
,	O
Update	O
,	O
Delete	O
)	O
.	O
</s>
<s>
By	O
creating	O
this	O
class	O
you	O
can	O
perform	O
CRUD	B-General_Concept
operations	O
on	O
http://localhost:8080/book	O
.	O
</s>
<s>
Currently	O
Grails	B-Language
does	O
not	O
provide	O
scaffolding	O
for	O
associations	O
.	O
</s>
<s>
The	O
persistence	B-Application
mechanism	O
in	O
GORM	O
is	O
implemented	O
via	O
Hibernate	B-Library
.	O
</s>
<s>
The	O
target	O
audience	O
for	O
Grails	B-Language
is	O
:	O
</s>
<s>
Java	O
or	O
Groovy	B-Application
developers	O
who	O
are	O
looking	O
for	O
an	O
integrated	O
development	O
environment	O
to	O
create	O
web-based	O
applications	O
.	O
</s>
<s>
Grails	B-Language
is	O
built	O
on	O
top	O
of	O
and	O
is	O
part	O
of	O
the	O
Java	O
platform	O
meaning	O
that	O
it	O
is	O
very	O
easy	O
to	O
integrate	O
with	O
Java	O
libraries	O
,	O
frameworks	O
and	O
existing	O
code	O
bases	O
.	O
</s>
<s>
Grails	B-Language
offers	O
transparent	O
integration	O
of	O
classes	O
which	O
are	O
mapped	O
with	O
the	O
Hibernate	B-Library
ORM	B-General_Concept
framework	O
.	O
</s>
<s>
This	O
means	O
existing	O
applications	O
which	O
use	O
Hibernate	B-Library
can	O
use	O
Grails	B-Language
without	O
recompiling	O
the	O
code	O
or	O
reconfiguring	O
the	O
Hibernate	B-Library
classes	O
while	O
using	O
the	O
dynamic	O
persistence	B-Application
methods	O
discussed	O
above	O
.	O
</s>
<s>
One	O
consequence	O
of	O
this	O
is	O
that	O
scaffolding	O
can	O
be	O
configured	O
for	O
Java	O
classes	O
mapped	O
with	O
Hibernate	B-Library
.	O
</s>
<s>
Another	O
consequence	O
is	O
that	O
the	O
capabilities	O
of	O
the	O
Grails	B-Language
web	B-Application
framework	I-Application
are	O
fully	O
available	O
for	O
these	O
classes	O
and	O
the	O
applications	O
which	O
use	O
them	O
.	O
</s>
<s>
Grails	B-Language
also	O
makes	O
use	O
of	O
the	O
Spring	B-Application
Inversion	B-Language
of	I-Language
Control	I-Language
Framework	O
;	O
Grails	B-Language
is	O
actually	O
a	O
Spring	B-Application
MVC	I-Application
application	O
under	O
the	O
hood	O
.	O
</s>
<s>
The	B-Application
Spring	I-Application
framework	I-Application
can	O
be	O
used	O
to	O
provision	O
additional	O
Spring	B-Application
beans	I-Application
and	O
introduce	O
them	O
into	O
the	O
context	O
of	O
the	O
application	O
.	O
</s>
<s>
Grails	B-Language
applications	O
are	O
packaged	O
as	O
war	O
artifacts	O
that	O
can	O
be	O
deployed	O
to	O
any	O
servlet	O
container	O
or	O
Java	O
EE	O
application	O
servers	O
.	O
</s>
