
Explore how Grails fits into the model view controller paradigm, install your development environment, build a working web app, and deploy a rewards application to the cloud.
Develop and deploy a cafe rewards app using Grails, building a customer database, calculating points and welcome messages, with login profile access and web pages for tablet and mobile devices.
Explore the Grails MVC framework to separate data, presentation, and logic. Learn how models, views, controllers, and templates interact to build scalable web applications.
Master Grails architecture by learning its full stack mvc components, Spring as core controller, Hibernate for data models, Groovy scripting, and Tomcat deployment.
Install Grails on Windows by installing the Java Development Kit and downloading the Grails libraries, then unzip them into a dedicated root directory on the C drive.
Set Java and Grails home environment variables on Windows, add their bin directories to the path, and verify installations with java -version and grails -version.
Install the Java development kit and Grails libraries on macOS or Linux, then use the Groovy environment manager to install Grails and verify with java -version and grails -version.
Install the groovy grails tool suite on Windows, Mac, and Linux by downloading from grails.org, choosing the 64-bit executable, and configuring a grails directory for projects.
Set up a Grails project using the Groovy Grails tool suite and configure the Grails installation. Run the app to verify Java, Grails, Groovy, database, Tomcat, and web server components.
Install the groovy 2.1 compiler extension in eclipse to fix the version mismatch between the Grails project and the tool suite, then restart and verify with a test app.
Create a new Grails project named rewards, then run the app and learn to resolve port conflicts by stopping or restarting the dispatcher or changing grails.server.port.http in the build config.
Learn to build a full stack Grails app by creating a controller and defining actions. Render simple text responses and understand how the index default action works.
Define variables, build a map to pass product and skew to a Groovy server page view, and display them in a form in the inventory edit action.
Create a product domain with name, skew, and price fields, using string for name and skew and a floating point for price; insert data via the DB console in development.
Fetch all products in the Product domain with a list action, pass them as all products to the list view, and render a table of name, skew, and price.
Design a domain model with customers, awards, orders, order items, and products, establishing one-to-many and many-to-many relationships via an order item, and specify each domain's fields.
Create five Grails domain classes (customer, award, order, order item, product) and define fields with appropriate types (string, long, integer, date, float). Prepare for defining relationships between domains.
Define bidirectional relationships in Grails with static hasMany and belongsTo, so customers have many awards and orders, and awards belong to a customer, enabling cascading behavior.
Refactor the order domain to online order using the Grails tooling, updating related domains and tests, then restart the app to confirm no errors.
Discover dynamic scaffolding in Grails: generate a full crud interface and views from your domain classes with a single line of code, without creating any physical files.
Explore static scaffolding in Grails, creating explicit controllers and views, enabling customization of actions and forms, while noting it requires regeneration when domains change and can be overwritten.
Define constraints in domain classes to ensure valid data and control how fields appear, including order in scaffolding, then restart the server to apply changes.
Learn how to enforce required fields and nullable constraints in Grails, using nullable: true to allow empty values and ensure proper validation at the database and view levels.
Learn how to enforce field value size using size, max size, and max constraints for strings and numbers, with real-time validation and scaffolding-aware error handling.
Apply the email constraint to enforce proper email format and use an in list constraint to limit award types to purchase or reward, with scaffolding generating a select field.
Bootstrapping pre-populates the database on server start by running a bootstrap groovy script that creates domain data, such as products with name, sku, and price.
Replace the default logo in Grails scaffolding with a transparent PNG, add it to the app's images folder, and update the main layout to display it.
Add a 32x32 gif favicon named cup icon to images and reference it in the layout. Refresh to view the favorite icon in the tab and bookmarks, noting IE11 compatibility.
Switch the default Grails green palette to a brown scheme by selecting four shades for hover, header/footer, title/text, and drop shadow, using the W3Schools color picker to obtain hex codes.
Change colors in the main cssa file to apply a brown theme across the header, footer, hover, and text using hex codes in the Grails app.
Learn the basic structure of a Grails view, including index gsp and the underscore form template, and how the main layout and templates enable reuse.
Mastering Grails 0606 text fields teaches how to create and style text field, text area, and password field in a GSP view using labels and Groovy tags.
Learn to add selectable fields in grails views by implementing a checkbox for email notifications and a gender radio group, configuring labels, values, and layout with groovey tags.
Create a select field (dropdown) with a prompt and options like Internet, friend, or other, with static or dynamic data via a query.
Install bootstrap in the Grails app and merge its files into the webapp. Create a bootstrap-enabled check-in view using a kiosk form template within the customer folder.
Shows how to build a responsive kiosk view using bootstrap's fluid grid, containers, and nested rows and columns to organize banners, status, phone number field, and button panels.
Build a kiosk banner section with Bootstrap's 12-column grid, creating a container, row, and image column, then wire a check-in action to render the view.
Builds a kiosk view with a two-column layout, exposing a welcome message in the first column and a phone number input in the second, using bootstrap grid and an offset.
Build a nested bootstrap number pad in a two-column kiosk view, arranging three-button rows. Buttons 1–9, 0, delete, and go populate the input field.
Change delete and go button colors to red and green using Bootstrap danger and success styles, adjust spacing with h-3, and improve readability by adding comments to clarify div closures.
Learn how to activate pad buttons using a simple JavaScript function on a Bootstrap view, sending button values to update the phone number field.
Learn how to define and use variables in groovey, including numbers, strings, and dates, render results to views, and perform basic math and concatenation with type inference.
Explore how to build and render strings in groovy by using variables, concatenation, and groovy strings to combine literal text with dynamic content.
Learn to create groovy strings that embed variables and logic using ${...}, including date retrieval, length calculations, and lowercase or uppercase conversions, for dynamic welcome text after sign-in.
Explore conditional branching in groovy by using if statements, tests, and else blocks to tailor messages based on total points, such as a welcome message or a free drink.
Master switch statements in Grails as alternative to if statements, using a variable, cases, and break with a default, and test ranges like 1 to 4 or 2 to 3.
Learn how to send data from views to controllers using params, query strings, and the address bar, including id, first, and points, with type conversions.
Lean controllers delegate data to a Grails calculation service, where the welcome action processes parameters and the controller returns a welcome message to the view.
Learn to query, sort, and paginate a Grails customer list, using bootstrap data and a view, and implement look up actions in the controller.
Master dynamic finders in Grails by using find all by a field to query domain data. Use find by for single results, and apply sorting and parameters to refine queries.
Master dynamic finders in Grails to query data using like and i like for strings, greater than and between for numbers, and multi-field, sorted results.
Master list and create actions in Grails with scaffolding, using the index action to display customers, handle new customer instances, and support pagination.
save a customer via the create form and redirect to show with the saved id, then the show action retrieves the customer by id.
Discover how Grails scaffolding handles edit, update, and delete actions, including querying by id, overlaying parameter changes onto existing properties, and redirecting to show or index views.
Loop through a customer's awards to sum points in a service and assign the total to the customer's total points in the controller's show action.
Configure the delete button as a groovey link that reopens the check in form via the check in action, clearing the phone number and welcome message while preserving styling.
Replace the go button with a Grails submit button to post the phone field to the controller for customer look up and reward addition.
Outline customer lookup action in the controller, querying by phone number to create or update a customer, award record, send a welcome message, and delegate logic to a service.
Create a look-up action that accepts a lookup instance from the kiosk form, delegates to a calculation service, and renders the check-in view with the customer instance and welcome message.
Wire the process check-in action to return a customer instance and a welcome message from the service, using a two-value return pattern with square brackets and parentheses for the controller.
Finish the service by looking up or creating a customer by phone, calculate total award points, apply the purchase award, and return the result to the controller for the view.
Finish the service by implementing a points based award system that adds purchase or reward entries to the customer's awards domain, using if statements, and save the kiosk flow.
Build a customer profile view to collect name and email, fetching the customer by phone from the URL. Use update profile to save changes and return to the profile view.
Create a custom Grails tag library action to format phone numbers, using a Groovy method that formats input as (xxx) xxx-xxxx and apply it in views via g:phone334.
Bundle the Grails app into a war file by editing the build config for app fog, downgrading to compatible Grails and Tomcat versions, and building the file in target.
Deploy Grails apps to production using server or cloud hosting, then use AppFog to sign up, configure memory and databases like my sequel, upload your app, and access it online.
Install the app fog tools from the command line by setting up a ruby environment, then run gem install af to install the scripts, enabling deployment.
Log in to app fog, push your Grails app from the target directory, and deploy to the cloud with memory, instances, and services, then access bootstrapped data online.
Redeploy your cloud app after changes by creating a new war file, updating it to fog, and using af update to restart as needed.
This Learning Grails training course from Infinite Skills shows you how to create dynamic, data-centric web applications using the Grails framework. This course is designed for the absolute beginner, meaning no prior knowledge of Grails is required.
You will start by learning how to install Grails on your operating system and learn how to setup a basic project. You will learn how to create a basic application stack, including creating a controller, view, and model. Mike will show you how to design the data layer, teaching you about dynamic and static scaffolding, bootstrapping data, and various constraints. This video tutorial will also cover designing the web and logic layer, managing data with GORM, and adding finishing touches to the application. Finally, you will learn how to package the application and create and manage an AppFog account.
Once you have completed this computer based training course, you will be fully capable of building a working web application with Grails. Working files are included, allowing you to follow along with the author throughout the lessons.