What is the Grails application library? -
What is the Grails application library? -
in book, definitive guide grails 2, see code fragment appear once: <g:javascript library="application"/>
no explanation there tell application library and/or does. know?
yes , know.
<g:javascript library="application"/>
no wonder ,and explain below.
this line speaking of javascript file named application.js
under /webapp/js/application.js
.
what ?
let if have multiple javascript file utilize different page of application.not , have 30 other more javascript file depending on javascript file .
then how load page? list them each file in each jsp file 1 1 ? sucks! , grails alleviated problem using resource plugin ...which defined under applicationresources.groovy
defined follow :
modules = { application { resource url:'js/application.js' resource url:'js/yourotherjavascript.js' resource url:'js/otherlibrary.js' } application2 { // point complied version resource url:'js/script_compiled.js' } }
as , can see script "application" refers javascript file refered under application definition , if u have other u can create name space , define below ...cheers~!
grails
Comments
Post a Comment