Getting started with the Grails Resources plugin

I am new to using Grails plugins, and this is most likely a newbie, but I cannot find the documentation that helps me, so we go.

I added the following file to grails-app / conf: appResources.groovy

//appResources.groovy modules = { css{ resource url:"/css/main.css" } } 

and in my main.gsp layout file I use <r:layoutResources /> at the beginning and before </body> . So far there have been no mistakes so well.

Now, in my opinion, gsp I have this (partially):

 //myView.gsp <head> <title>title</title> <meta name="layout" content="main" /> <r:require module="css" /> </head> 

When I go to the page view, I get the following error:

 Exception Message: No module found with name [css] Caused by: Error executing tag <g:applyLayout>: Error executing tag <r:layoutResources>: ... 

I did my reading and I think I need to do something in Config.groovy to get grails to read appResources.groovy, but I have no idea what to write. Thanks everyone!

+4
source share
1 answer

The standard file name is ApplicationResources.groovy . It will be automatically raised.

Be sure to install grails.resources.work.dir in Config.groovy in a stable location to prevent resources problems during product deployment.

+2
source

Source: https://habr.com/ru/post/1392805/


All Articles