... Listing 1 3 -1 1 shows the SimpleCacheGrailsPlugin class and the place-
holder fields used to supply this information.
Listing 1 3 -1 1. The SimpleCacheGrailsPlugin Plugin Descriptor
class SimpleCacheGrailsPlugin ... represents the plugin descriptor. Figure 1 3 -1 shows the plugin
descriptor residing snugly in the root of the project.
Figure 1 3 -1 . The simp...
... relates to associations. The easiest
case to understand is many -to- one and one -to- one associations. For example, consider the
artist property of the Album class, which is a many -to- one association, ... all the information that Grails needs to carry out the redirect, includ-
ing the name of the action to redirect to. In addition, the map can contain the nam...
... based on the supplied
attributes, which include the following:
• controller: The controller name to link to
• action: The action name to link to
• id: The identifier to append to the end of the URI
• ... UNDERSTANDING VIEWS
13 1
The only attribute specified in this call to the paginate tag is the required total attribute.
Notice that in this case the val...
... amazon-a3s-*-java-library.jar file into your project
lib directory.
4. Copy the required dependencies commons-codec- 1- 3 .jar and commons-httpclient-
3.0 .1. jar from the third-party/jakarta-commons directory to your project’s ... INTERNATIONALIZATION
Figure 7 -1 . The grails- app/i18n/ directory
The messages.properties file in the grails- app/i18n/ directory contains defaul...
... how the name of the view to transition to is the return value of the closure passed
to the to method. In other words, the following three examples are equivalent, with each tran-
sitioning to the ... spread operator to invoke
9 between(key, *value)
10 }
11 else {
12 like(key,value)
13 }
14 }
15 }
16
17 // create a criteria instance
18 def criteria = Album.cr...
... the album-art plugin, you need to install the simple-cache plu-
gin that the album-art plugin is dependent on into the gTunes application:
$ grails install-plugin /simple-cache /grails- simple-cache-0 .1. zip
With ... Listing 1 4-5 1 that if the User does have access to the
Album, then a “Back to My Music” link is displayed instead, allowing the user to navigate...
... albums:artist?.albums
10 xml { render artist as XML }
11 }
12 }
13 else {
14 response.sendError 404
15 }
16 }
17
18 }
The code in Listing 1 5-6 shows how to handle a request when the URL mapping in
Listing 1 5-4 ...
designed to specify the incoming content type of the request. To try a client that uses the
CONTENT_TYPE header, open the Grails console ag...
... relationship type to consider is a many -to- many association. A many -to- many
association is mapped using a join table in a similar way to a unidirectional one -to- many associ-
ation. Figure 1 7-3 shows ... relationship.
Figure 1 7-3 . How Grails maps a many -to- many association
You can change the way a many -to- many association maps onto the underlying database
using...