-
Book Overview & Buying
-
Table Of Contents
Grails 1.1 Web Application Development
By :
The first step to allow users to post messages is to present them with a form to enter the message data. To do this, you need to create a controller to handle the users request, and a view to show the form.
Create a file called MessageController.groovy under the grails-app/controllers/app directory and place the following code in the new file:
package app
class MessageController {
def create = {
}
def save = {
}
}
Here you have created a controller for messages that can handle two actions: create and save. The following new URLs are now available in the application:
http://localhost:8080/teamwork/message/create
http://localhost:8080/teamwork/message/save
Of course, these URLs won't do anything yet as you have neither added any behavior to the controllers, nor created any views to render information to the user. The next step is to add the view for the Create Message page.
Groovy Server Pages (GSP) is the default view template language...
Change the font size
Change margin width
Change background colour