Search code examples
grailsgsp

Changing Grails default index.gsp page?


I want to change grails default index page with 1 that i had designed.. In my newly created gsp file which include CSS also the CSS which is not written inside the .gsp file, its out side of it..when i tried to put my css file and index file in app view folder and when i run the app it's not displaying properly showing the error that

enter image description here


Solution

    1. You should put your .css files into web-app/css directory
    2. Use <g:resource tag to make valid url for such resources (correct url going to be /prqapp/css/base.css, not just a /css/base.css).

    So, your code should looks like:

    <link type="text/css" href="${resource(dir: 'css', file: 'base.css')}" />
    <link type="text/css" href="${resource(dir: 'css', file: 'layout.css')}" />
    <link type="text/css" href="${resource(dir: 'css', file: 'skeleton.css')}" />
    

    See docs for