开发者

Include .js file in All Gsp file in STS (Eclipse) IDE?

开发者 https://www.devze.com 2023-03-14 23:04 出处:网络
is there any way to include a file in all gsp file header ? i want to include a file <g:javascript src=\"hotkey.js\"/>

is there any way to include a file in all gsp file header ? i want to include a file

<g:javascript src="hotkey.js"/> 

in all Gsp files head开发者_开发知识库e part. i'm using STS (SpringSource Tool Suite).


If you include your .js files in main.gsp then it will automatically be included in all gsps with the tag <meta name="layout" content="main" /> in the <head>. Example gsp head below:

   <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <meta name="layout" content="main" />
    <g:set var="entityName" value="${message(code: 'transactionRecord.label', default: 'TransactionRecord')}" />
    <title><g:message code="default.create.label" args="[entityName]" /></title>
</head>

The main layout is automatically included in all gsps generated by the scaffolding create commands.

0

精彩评论

暂无评论...
验证码 换一张
取 消