... the first-level cache. Although the first-level cache stores actual persistent instances for
the scope of the Session, the second- level cache exists for the whole time that the SessionFac-
tory ... Listing 1 3-2 4 shows how to use dependency injection to get hold of a refer-
ence to the CacheService in the CacheTagLib. The cacheOrReturn method is then used to c...
... 97 8-1 -5 905 9-9 9 5-2
ISBN-10 (pbk): 1-5 905 9-9 9 5-0
ISBN-13 (electronic): 97 8-1 -4 30 2-0 87 1 -6
Printed and bound in the United States of America 9 8 7 6 5 4 3 2 1
Trademarked names may appear in this book. Rather than use ... Listing 1-1 1).
Listing 1-1 1. Running an Application with run-app
200 8-0 6- 1 9 23:15: 46. 523:/gTunes:INFO: Initializing...
... 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
• ... is received. Then if the command object has no errors, the user is placed
into the session and the request is redirected to the StoreController.
Testi...
... 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 default...
... 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 ... instant-search box and the top-five-songs panel are hard-coded into the
grails- app/views/store/shop.gsp view, so start by extracting those into templates called
_se...
... jsecurity-0.2.1 installed
Plug-in provides the following new scripts:
grails create-auth-controller
grails create-db-realm
grails create-ldap-realm
grails quick-start
As you can see from the output ... 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...
... use other beans as factories. For example, to create another bean
from the calendarBean in Listing 1 6- 9 , you can simply pass the name of the bean as an argu-
ment to the bean-defining method:
USCalendar(calendarBean) ... rendered like the one in Figure 1 5 -6 .
Figure 1 5 -6 . Firefox rendering of an RSS feed
RSS and Atom Link Discovery
Another feature of most RSS and Ato...
... this a many -to- many 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 the same joinTable ... in Listing 1 7-4 maps the artist property to a column called R_CREATOR_ID.
A one -to- many association requires a little more thought. First you need to consider wh...