Building a Grails Pet Catalog using Netbeans 6.5 and MySQL
http-equiv="content-type">
Building a Grails Pet Catalog using Netbeans 6.5 and MySQL
This Catalog Sample app demonstrates the usage of Groovy and Grails to
implement pagination of data sets for a Store Catalog.
href="https://techdayscode.dev.java.net/servlets/ProjectDocumentList?folderID=10975&expandFolder=10975&folderID=0">
download Catalog sample code
Overview of the Technologies and Frameworks in the Sample Application
Grails aims to bring the
"coding by convention" paradigm to Groovy. It's an open-source web
application framework that leverages the Groovy language and
complements Java Web development.
Groovy is an agile and dynamic
language for the Java Virtual Machine, it compiles
to Java bytecode, and it combines popular features from
languages such as Smalltalk, Python, and Ruby.
MySQL is the
world's most popular open-source database. It offers
consistently fast performance, high reliability and ease of use.
The NetBeans
IDE 6.5 , in addition to full support of all Java platforms (Java
SE, Java EE, Java ME, and JavaFX), has support for software development
with PHP, Ajax and JavaScript, Groovy and Grails, Ruby and Ruby on
Rails, and C/C++. Netbeans 6.5 feature highlights for Groovy
and Grails:
- Develop pure Groovy apps or use Groovy in Java SE projects
- Groovy editor with code completion, highlighting, and more
- Grails web application framework
- Open existing Grails applications without adding metadata
Grails is a
Model-View-Controller based framework that simplifies the development
of web applications by reducing the need for configuration files
and by generating a lot of the things needed in
a database-backed Web application.
style="width: 304px; height: 334px;">
The Sample Application
The sample application displays an online catalog of pets sold in a pet
store. The image below shows the Catalog Listing page, which allows a
user to
page through a list of items
in a store.
style="width: 493px; height: 572px;">
Setting Things Up:
- If MySQL
is already not already installed, then href="http://dev.mysql.com/downloads/">download MySQL and
install it.
- Download
and
install Netbeans 6.5 bundled with Glassfish v3 Prelude.
- Download
and install Grails.
- Start NetBeans IDE.
- In the Netbeans IDE, select Tools Options Groovy and set
the location of the Grails package, which you installed using the
Glassfish v3 updatetool.
style="width: 411px; height: 383px;">
Creating the Catalog Database Item table
style="font-weight: bold;">:
- Download the
href="https://techdayscode.dev.java.net/servlets/ProjectDocumentList?folderID=10975&expandFolder=10975&folderID=0">sample
code and extract its contents. You should now see the newly
extracted directory as<sample_install_dir>/catalog,
where<sample_install_dir>is the directory where
you unzipped the sample package. For example, if you extracted the
contents toC:\on a Windows machine, then your newly
created directory should be atC:\Catalog.
- In the Netbeans IDE, Click Open Project in the File menu
and
select thecatalogdirectory you just
unzipped.
The
file
"/catalog/grails-app/conf/DataSource.groovy"
is configured
for MySQL.
- Start the MySQL database as follows:
- Click the Services tab in the NetBeans IDE.
- Expand the databases node. You should see the MySQL server
database in the list of databases.src="http://weblogs.java.net/blog/caroljmcdonald/archive/databaselist.jpg" height="62" width="267">
- Right-mouse click on the MySQL server database and
select
Start.
- Create the catalog database as follows:
- Right-mouse click on the MySQL server database and
select
Create Database. - Enter the database name petcatalog and userid root and
password admin. This will open a New
Database Connection window. Click O.K. to accept the displayed
settings.
- Right-mouse click on the MySQL server database and
- Create the tables in the MySQL catalog database as follows:
- Expand the Drivers node. You should see a driver for the
petcatalog
database in the list of drivers.src="http://weblogs.java.net/blog/caroljmcdonald/archive/driverlist.jpg" height="26" width="252">
- Right-mouse click on the petcatalog driver and select Connect.
- Right-mouse click on the petcatalog driver and select Execute
Command. This will open up a SQL command window. - Copy the contents of the
catalog.sqlfile
in the<sample_install_dir>/Catalog
directory and paste the contents into the
SQL command window. - Click the Run SQL icon
src="http://weblogs.java.net/blog/caroljmcdonald/archive/runsql.jpg" height="28" width="28">
(Ctrl+Shift+E) above the SQL command window.
- Expand the Drivers node. You should see a driver for the
- Ensure that the username and password settings in the
catalog\grails-app\conf\DataSource.groovy
file are the
same as the corresponding property settings in NetBeans
IDE 6.5 for your MySQL server database.
Running the Sample Code:
- Run the project as follows:
- Right click the
catalognode in
the
Projects window.
- Select Run Project.
- Right click the
When you run the project, your browser should display the opening page
of the Sample Application (at
http://localhost:8080/catalog/).
style="width: 309px; height: 335px;">
How to Create the Catalog Sample Application with Netbeans 6.5 and
MySQL
Creating the Application
- Run the "grails create-app" command from the IDE, by using
the
IDE "Grails Application" project template to create a new Grails
application as follows:
- Choose File > New Project (Ctrl-Shift-N) and then
select "Grails Application" from the "Groovy" category. Click Next.
- In Project Name, type "catalog"; in Project Location,
select the folder where the application will be created. Click Finish.
style="width: 606px; height: 315px;">
The IDE runs the "grails create-app" command, showing the output in the
Output window. The Projects window should show you this:
style="width: 235px; height: 418px;">
Expand the folders and have a look at the source structure created by
the IDE via the Grails scripts. Also look at the generated files and
notice that many of them have default values filled in.
- Choose File > New Project (Ctrl-Shift-N) and then
Configure Your Grails app data source
for MySQL database
Configuring the data source is a simple matter of changing the
values
for the desired database and driver and placing the driver jar file in
the <..>/lib directory.
- Download MySQL Connector/J 5.1.6 from href="http://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-5.1.6.tar.gz/from/pick?file=Downloads/Connector-J/mysql-connector-java-5.1.6.tar.gz&mirror=pick#mirrors">here.
- Extract the bundle and copy the
"mysql-connector-java-5.1.6-bin.jar" to the "lib" directory of your
Grails
application: catalog\lib. - Double click on the file
"catalog\grails-app\conf\DataSource.groovy" to edit in order to change
the values for MySQL
configuration. The updated file looks like this (changes highlighted in style="color: rgb(153, 0, 0);"> style="font-weight: bold; color: rgb(153, 0, 0);">red):
border="1" cellpadding="2" cellspacing="0">
Code Sample from: catalog\grails-app\conf style="font-weight: bold;">\DataSource.groovy
dataSource {
pooled = true
driverClassName = " style="color: rgb(153, 0, 0);">com.mysql.jdbc.Driver"
username = "root"
password = ""
// your mysql password here
dialect = "org.hibernate.dialect.MySQL5InnoDBDialect"
}
hibernate {
cache.use_second_level_cache=true
cache.use_query_cache=true
cache.provider_class='com.opensymphony.oscache.hibernate.OSCacheProvider'
}
// environment specific settings
environments {
development {
dataSource {
dbCreate =
"update" // one of
'create', 'create-drop','update'
url =
"jdbc:mysql://localhost/petcatalog"
}
}
test {
dataSource {
dbCreate =
"update"
url =
"jdbc:mysql://localhost/petcatalog"
}
}
production {
dataSource {
dbCreate =
"update"
url =
"jdbc:mysql://localhost/petcatalog"
}
}
}
Being in production, it's recommended to use href="http://dev.mysql.com/doc/refman/5.0/en/innodb.html">InnoDB
tables instead of href="http://dev.mysql.com/doc/refman/5.0/en/myisam-storage-engine.html">MyISAM
tables. This can be easily specified by using the dialect as
explained href="http://grails.markmail.org/message/efk2iv6a2fenhvnp?q=list:user">here.
More details about the contents of "DataSource.groovy" can be found href="http://grails.org/doc/1.0.x/guide/3.%20Configuration.html">here.
Creating the Domain Class
- use the IDE to run the "grails create-domain-class" script as
follows:- Right-click on the Domain Classes node and choose New
> Grails Domain Class.
style="width: 470px; height: 246px;">
- Name the domain class "Item" and click Finish. The
"Item.groovy" domain class is created in the Domain Classes node.
style="width: 463px; height: 272px;">
- Right-click on the Domain Classes node and choose New
- Double click on the catalog\grails-app\domain\Item.groovy class
to open it in the
editor and add the attributes shown in red below to the item class.
cellspacing="0">
Code Sample from: catalog\grails-app\domain\Item.groovy
class Item
{
Long id
style="color: rgb(204, 0, 0);">
String name
style="color: rgb(204, 0, 0);">
String description
style="color: rgb(204, 0, 0);">
String imageurl
style="color: rgb(204, 0, 0);">
String
imagethumburl
BigDecimal price
style="color: rgb(0, 0, 153); font-weight: bold;">
}
The Model - Grails Domain Classes
The Model is your application's persistent business domain objects.
A Grails domain
object
instance represents a row in a database table. The command
grails
create-domain-class Item generates the style="color: rgb(0, 0, 153); font-weight: bold;">Item.groovyclass shown below corresponding to the item database table.
After model code
generation you have to
add the domain object's attributes and relationships.
| Code Sample from: domain\Item.groovy |
|
CREATE TABLE item (
id INT NOT NULL,
product_id BIGINT NOT NULL,
name VARCHAR(30) NOT NULL,
description VARCHAR(500) NOT NULL,
imageurl VARCHAR(55),
imagethumburl VARCHAR(55),
price DECIMAL(14,2) NOT NULL,
primary key (id),
);
Groovy with Grails dynamically generates getters and setters and the
dynamic
methods Item.save(), Item.delete(), Item.list(), Item.get() to
retrieve/update data from/to
the db table.
Grails Object Relational Mapping (GORM) is currently built on top of
Hibernate but you don't have to know Hibernate to use it.
Creating the Controller and Views
- use the "grails generate-all" script to create a controller and
views
for the domain class as follows:- Right-click the Controllers node and choose New >
Grails Controller.
style="width: 343px; height: 290px;">
- The Item controller and Item views are
generated.
- Right-click the Controllers node and choose New >
The Controller
Controllers handle incoming http requests, interact with the model to
get data and to process requests, invoke the correct view, and
direct domain data to the view for display.
In Grails, http requests are handled by Controller classes which
are made up
of one or more action methods that are executed on request and then
either render
a Groovy Server Page or redirect to another
action. Grails routes requests to the controller action which
corresponds to the URL mapping for the request. In Grails the default
mapping from URL to action method follows this convention: http://host/ style="font-weight: bold;">app/controller/action/id . For
example the URL http://host/catalog/item/list
calls the
list style="font-family: monospace; font-weight: bold;"> style="color: rgb(0, 0, 153);"> style="font-weight: bold;">action method in the style="font-weight: bold;"> item controller style="font-family: monospace;"> style="color: rgb(0, 0, 153); font-weight: bold;">class
shown below. href="http://grails.codehaus.org/Scaffolding">Grails
Scaffolding provides a series of standardized
Controller action methods for listing, showing, creating, updating, and
deleting
objects of a class. These standardized actions
come with both controller logic and default view Groovy Server Pages.
The commandgenerate-all
Itemgenerates the Item controller and the List, Show, Create, Edit
Groovy Server Pages for the Item domain object. The style="font-family: monospace;"> style="color: rgb(0, 0, 153); font-weight: bold;">ItemController
style="color: rgb(0, 0, 153); font-weight: bold;">list
action renders a view with a paginated list of item objects.
| Code Sample from: catalog\grails-app\controllers style="font-weight: bold;">\ItemController.groovy |
class ItemController { def index = { redirect(action:list,params:params) } style="font-family: monospace;"> def list = { if(!params.max) params.max = 10 [ itemInstanceList: Item.list( params ) ] } . . . |
When a URL has a controller but no action (e.g.
http://localhost:8080/catalog/item/ ), Grails defaults to the
index action. In the
style="font-weight: bold;">
style="font-family: monospace;">
style="color: rgb(0, 0, 153); font-weight: bold;">ItemController
code the
style="color: rgb(0, 0, 153); font-weight: bold;">
style="font-family: monospace;">
style="color: rgb(0, 0, 153); font-weight: bold;">index
action method redirects to the
style="color: rgb(0, 0, 153); font-weight: bold;">list
action. The
style="color: rgb(0, 0, 153); font-weight: bold;">ItemController
style="color: rgb(0, 0, 153); font-weight: bold;">list action
method calls the
style="color: rgb(0, 0, 153); font-weight: bold;">Item.list() method
which returns an ArrayList of item objects retrieved from the item
database table . If there are more than
style="font-family: monospace;">params.max objects in the
table, Grails creates next and previous pagination links automatically.
The itemInstanceList
style="font-family: monospace;">
style="font-family: monospace;"> variable is
automatically made available to the view by the framework.
After executing
code, actions usually render a GSP in the views directory
corresponding to the name of the controller and action, for example the
list action will render the catalog\grails-app\views\item\list.gsp .
Running the Application
The catalog Grails application is ready to run:.
- Right-click the application and choose "Run".
- When you run the project, your browser should display the opening
page
of the Sample Application (at
http://localhost:8080/catalog/) . If the
browser does not
open automatically, paste the URL into a browser and then you'll see
your application.
style="width: 406px; height: 422px;">
- Click the "ItemController" link and you'll see this:

Modifying The View
The view layer generates a web
page, using data from domain objects provided by the controller. In
Grails, the view is rendered using href="http://docs.codehaus.org/display/GRAILS/Developer+-+Groovy+Server+Pages">Groovy
Server Pages.
Modifying the List View GSP
- Copy the sub directory images style="font-weight: bold;">from the sample application
directory catalog\web-app\ to
your application's catalog\web-app\ directory. - Double click on the file
"catalog\grails-app\views\item\ list.gsp" to edit in order to modify
the item list table. Make the changes highlighted in style="font-weight: bold; color: rgb(153, 0, 0);">red):
cellspacing="0">
Code Sample from: grails-app\ style="font-weight: bold;">views\item\list.gsp
<table>
<thead>
<tr>
style="font-weight: bold; color: rgb(153, 0, 0);"><g:sortableColumn style="color: rgb(153, 0, 0);">
property="name" title="Name" />
style="color: rgb(153, 0, 0);">
<g:sortableColumn
property="imagethumburl" title="Photo" />
style="color: rgb(153, 0, 0);">
<g:sortableColumn
property="price" title="Price" />
</tr>
</thead>
<tbody>
style="color: rgb(0, 0, 153); font-weight: bold;"><g:each
in="${itemInstanceList}"
status="i"
var="item style="color: rgb(0, 0, 153);">Instance">
<tr class="${(i % 2) == 0
? 'odd' : 'even'}">
style="color: rgb(153, 0, 0);"><td>
style="color: rgb(153, 0, 0);">
<g:link action="show" id="${itemInstance.id}">
style="color: rgb(153, 0, 0);">
${fieldValue(bean:itemInstance, field:'name')}</g:link>
style="color: rgb(153, 0, 0);">
</td>
<td>
<img src="${itemInstance.imagethumburl}" alt="Pet" />
style="color: rgb(153, 0, 0);">
</td>
<td>
${fieldValue(bean:itemInstance, field:'price')}
style="color: rgb(153, 0, 0);">
</td>
</tr>
</g:each>
</tbody>
</table>
<div class="paginateButtons">
<g:paginate
total="${Item.count()}" />
</div>
The view uses instance variables set by the controller to
access the data it needs to render the GSP.
GSP has a GroovyTagLib similar to the JSP tag library.<g:are
GroovyTags.
style="font-weight: bold;"><g:sortableColumn
The href="http://grails.codehaus.org/GSP+Tag+-+sortableColumn">sortableColumn
tag renders a sortable column to support sorting in tables.
<g:each
in="${itemInstanceList}" status="i"
var="itemInstance">
loops through each object in
theitemInstanceListstyle="font-family: monospace;"> variable,
which is an ordered style="font-weight: bold;">ArrayList of
modelstyle="color: rgb(0, 0, 153); font-weight: bold;">Item
objects, and assigns eachstyle="color: rgb(0, 0, 153); font-weight: bold;">Item
model object to the
variable.style="color: rgb(0, 0, 153); font-weight: bold;">iteInstance
<g:link
action="show"
id="${itemInstance.id}"> ${fieldValue(bean:itemInstance,
field:'name')} </g:link>
GroovyTag creates an html anchor taghref="http://grails.org/doc/1.0.x/ref/Tags/link.html">the
<g:link>href
based on theaction,id,controller
parameters specified. In this example it generates a link to the
item/show/id action which when clicked will display the
corresponding item details. For
example this line will generate the following HTML for the variableitem:
<a class="attribute-name"> href="/catalog/item/show/2">Friendly Cat</ class="end-tag">a>
style="color: rgb(0, 0, 153); font-weight: bold;"><img
src="${itemInstance.imagethumburl}" alt="Pet" />sets the HTML img tag to thestyle="color: rgb(0, 0, 153); font-weight: bold;">item's
imagethumburl
attribute.style="color: rgb(0, 0, 153); font-weight: bold;">
${fieldValue(bean:itemInstance,
field:'price')}
displays the value of the
attributestyle="color: rgb(0, 0, 153); font-weight: bold;">item 's price
.
<g:paginate
total="${Item.count()}" /> - Save your modifcations in the editor. Click reload current page
on your
browser. The Item List page should now look like the image below:
style="width: 511px; height: 529px;">
The Show Action Method
In Grails the mapping for the URL http://host
class="attribute-value">/item/show/1 (
http://host/controller/action/id
) will
route to the
style="color: rgb(0, 0, 153); font-weight: bold;">show
action in the
style="color: rgb(0, 0, 153); font-weight: bold;">ItemController
passing 1 to the method as the
style="color: rgb(0, 0, 153); font-weight: bold;">id of
the
style="color: rgb(0, 0, 153); font-weight: bold;">params parameter
hash. The
style="color: rgb(0, 0, 153); font-weight: bold;">show
action of the
style="color: rgb(0, 0, 153); font-weight: bold;">ItemController class
is shown below. The
style="color: rgb(0, 0, 153); font-weight: bold;">ItemController
style="color: rgb(0, 0, 153); font-weight: bold;">show
action renders a view showing the details of the item object
corresponding to the id parameter.
| Code Sample from: grails-app\controllers\ItemController.groovy |
def show = { def itemInstance = style="color: rgb(0, 0, 153); font-weight: bold;">Item.get( style="color: rgb(0, 0, 153); font-weight: bold;">params.id ) if(!itemInstance) { flash.message = "Item not found with id ${params.id}" redirect(action:list) } else { return [ itemInstance : itemInstance ] } } |
The
style="color: rgb(0, 0, 153); font-weight: bold;">show
action method calls the
style="color: rgb(0, 0, 153); font-weight: bold;">Item.get()
style="color: rgb(0, 0, 153); font-weight: bold;">
style="font-family: monospace;"> style="color: rgb(0, 0, 153); font-weight: bold;">method
which queries the items table returning the style="font-family: monospace;"> style="font-family: monospace;"> style="color: rgb(0, 0, 153); font-weight: bold;">itemInstance instance
variable corresponding to the item with the attribute style="font-family: monospace;"> style="color: rgb(0, 0, 153); font-weight: bold;">id
(primary key)
equal to the style="color: rgb(0, 0, 153); font-weight: bold;">id
parameter. This is the equivalent of the following sql : style="font-family: monospace;">select * from items where id=' style="font-family: monospace;"> style="color: rgb(0, 0, 153); font-weight: bold;">1' .
The style="color: rgb(0, 0, 153); font-weight: bold;">ite style="font-family: monospace;">mInstance variable
is automatically made available to the Show view by the framework. style="font-weight: bold;">Modifying the Show View GSP
After executing
code in the action, the style="color: rgb(0, 0, 153); font-weight: bold;">show action
renders the catalog\grails-app\views\item\show.gsp.
- Double click on the file
"catalog\grails-app\views\item\show.gsp" to edit in order to modify
the item show view. Make the changes highlighted in style="font-weight: bold; color: rgb(153, 0, 0);">red below:
cellspacing="0">
Code Sample from: catalog\grails-app\views\item\show.gsp
<table>
<tbody>
style="color: rgb(153, 0, 0);"> <tr class="prop">
style="color: rgb(153, 0, 0);">
<td valign="top" class="name">Name:</td>
style="color: rgb(153, 0, 0);">
<td valign="top" class="value">${itemInstance.name}</td>
style="color: rgb(153, 0, 0);">
</tr>
<tr class="prop">
<td valign="top" class="name">Description:</td>
style="color: rgb(153, 0, 0);">
<td valign="top"
class="value">${itemInstance.description}</td>
style="color: rgb(153, 0, 0);">
</tr>
<tr class="prop">
<td valign="top" class="name">Photo:</td>
style="color: rgb(153, 0, 0);">
<td><img src="${itemInstance.imageurl}" alt="Pet"
/></td>
</tr>
<tr class="prop">
<td valign="top" class="name">Price:</td>
style="color: rgb(153, 0, 0);">
<td valign="top" class="value">${itemInstance.price}</td>
style="color: rgb(153, 0, 0);">
</tr>
</tbody>
</table>
${itemInstance.description}displays the value of thestyle="color: rgb(0, 0, 153); font-weight: bold;">item 'sdescriptionattribute.style="color: rgb(0, 0, 153); font-weight: bold;">
<img
src="${itemInstance.imageurl}" />style="color: rgb(0, 0, 153); font-weight: bold;">sets the HTML
image tag for thestyle="color: rgb(0, 0, 153); font-weight: bold;">item's imageurl
attribute.
${itemInstance.price}displays the value of thestyle="color: rgb(0, 0, 153); font-weight: bold;">item'sstyle="font-family: mon;">priceattribute.style="color: rgb(0, 0, 153); font-weight: bold;">
- Save your modifcations in the editor. Click reload current page
on your
browser.
The image below shows the resulting page for the url
http://host/catalog/item/show/1, which displays the item 1's
details:
alt="" src="http://weblogs.java.net/blog/caroljmcdonald/archive/showdetail1.jpg"
style="width: 430px; height: 489px;">
Layouts
Grails layouts
let you put common html on multiple views (for
example page headers, footers, sidebars). Default layout
templates are in the views layouts directory with a file name
corresponding to the controller, or you can associate a view with a
layout using the "layout" meta tag to your page:
<meta name="layout" content= class="code-quote">"main">
To replace the Grails logo with a title and parrot image at the
top of the Pet Catalog pages, put this table in the
catalog\grails-app\views\layouts\main.gsp layout page: id="intelliTxt">
| Code Sample from: app/views/layouts/main.gsp | ||
|
The image below shows the result on the show page after modifying
main.gsp layout page :
style="width: 622px; height: 696px;">
file to
Running you Grails app on Glassfish v2:
Netbeans does not yet support deploying grails app directly
to Glassfish, but you can create a WAR file and deploy it on Glassfish
as follows:
- If Jetty is running stop it: click on the IDE Services Tab, Under
the Jetty server right-click on the catalog app and select Stopalt="" src="http://weblogs.java.net/blog/caroljmcdonald/archive/stopjetty.JPG"
style="width: 230px; height: 284px;">
- Right-click on the catalog project node and choose Create War
File.
style="width: 285px; height: 225px;">
- Rename the
catalog-0.1.war
catalog.war.Copy the
catalog.war file from your catalogdirectory to your
Glassfish installation glassfish-v2ur2\domains\domain1\autodeploy
directory. Start Glassfish.
Enter the URL http://localhost:8080/
catalog/ in
your browser, you should see the home page of the Sample
Application.
Running you Grails app on Glassfish v3:
GlassFish
v3 Prelude is a lightweight
Web 2.0 development and deployment
platform built on a modular OSGi-based architecture. Developers can
benefit from a dynamically extensible and embeddable platform with
support for existing Java Web technologies, JRuby, and Groovy.
GlassFish Support For Grails Framework adds the Grails framework to
the GlassFish application server and allows development and easy
deployment
of Grails applications. Applications can be deployed in shared or
standalone mode. Shared mode allows library reuse and results in much
smaller war files.
-
href="http://wiki.glassfish.java.net/Wiki.jsp?page=GrailsGettingStarted">Install
the Grails href="http://wiki.glassfish.java.net/Wiki.jsp?page=GrailsGettingStarted">package href="http://wiki.glassfish.java.net/Wiki.jsp?page=GrailsGettingStarted">
to Glassfish v3 using the updatetool. Start the GlassFish
Update Center by issuing the following command:GF_install\updatecenter\bin\updatetool.
Check the GlassFish Support for Grails Framework checkbox in the
GlassFish Update Center and click Install. - Read the Glassfish
href="http://wiki.glassfish.java.net/Wiki.jsp?page=GrailsGettingStarted">Getting
started with Grails.
Conclusion
This concludes the sample application which demonstrates how to work
with Groovy and Grails to page through a list
of Item Model objects
which are retrieved using Item
Controller action methods, and
displayed using Item View GSPs.
References
- href="http://weblogs.java.net/blog/arungupta/archive/2008/04/totd_31_crud_ap.html"> MySQL
- Grails framework
- Groovy
-
href="http://www.netbeans.org/kb/docs/web/grails-quickstart.html">Introduction
to the Grails Web Framework with Netbeans
- Login or register to post comments
- Printer-friendly version
- caroljmcdonald's blog
- 8439 reads



style="width: 309px; height: 335px;">


Comments
Building a Grails Pet Catalog
by Alexandor - 2011-03-13 17:41
Hi there, I am trying to do this guide, but the link to the sample code is not working, is there a way to get it?
I will very grateful if you can help me.
Thx
by tonecool - 2009-02-16 08:42
Nice tutorial, thanks Carol :)