Delete
Setting
Add New Item
Menu List
Title | Content Type | Order | Action | ||||||
---|---|---|---|---|---|---|---|---|---|
{{kb_content.name}} {{kb_content.name}} | {{setValue(content_types, kb_content.content_type)}} | {{kb_content.sort_order}} | Preview Edit Edit Content | ||||||
{{kb_content.name}} | {{setValue(content_types, kb_content.content_type)}} | {{kb_content.sort_order}} | Preview Edit Edit Content | ||||||
No record |
Step 3: Create Landing/Home page
This is complete tutorial to build an application using grails 3.x. There are several parts of tutorial where every part has a specific objective and several steps. So it is a step by step tutorial to build a complete application using grails 3.x.
For page or any action, we need to create controller at first according to MVC pattern. We can create controller manually (click right button on controller in grails-app> controller , click new then click grails controller and give controller name and click ok) or using grails command as like
grails> create-controller site
After than you will see controller as like
package grailscrud class SiteController { def index() { } }
Here index() automatically call a view with location views/site/index. So we need to create a view named index.gsp under views/site/index and write something in this view and according to MVC pattern URL for that action will be http://localhost:8080/site/index
If you want to see this page is as default, you have to change in controller/projectname/urlMapping file as like:
static mappings = { "/$controller/$action?/$id?(.$format)?"{ constraints { // apply constraints here } } "/"(controller: 'site',action: 'index') // "/"(view:"/index") "500"(view:'/error') "404"(view:'/notFound') }