我有一个 grails 应用程序,我集成了 Bootstrap 3。 除了我的页面中未显示/显示字形外,一切正常。
我的登录页面中有以下代码。
<div class="input-group">
<span class="input-group-addon ">
<i class="icon-user icon-color"></i>
</span>
<input type="text" class="form-control " placeholder="Username" required="required" />
</div>
我页面上显示的是:
[橙色圆圈表示字形应该出现/显示的位置]
CSS:
@font-face {
font-family: 'FontAwesome';
src: url('../fonts/fontawesome-webfont.eot');
src: url('../fonts/fontawesome-webfont.eot?#iefix&v=3.2.1') format('embedded-opentype'), url('../fonts/fontawesome-webfont.woff') format('woff'), url('../fonts/fontawesome-webfont.ttf') format('truetype'), url('../fonts/fontawesome-webfont.svg#fontawesomeregular') format('svg');
font-weight: normal;
font-style: normal;
}
我的文件夹结构
我在 Config.groovy 中添加了/fonts/* 之类的
// What URL patterns should be processed by the resources plugin
grails.resources.adhoc.patterns = ['/images/*', '/css/*', '/js/*', '/plugins/*', '/fonts/*']
Google Chrome (F12) 中显示的错误
最佳答案
spring-security 的规则可能没有在 Config.groovy 上配置 :),参见:
grails.plugin.springsecurity.controllerAnnotations.staticRules = [
(...)
'/**/fonts/**': ['permitAll'],
(...)
]
关于css - Bootstrap 3 Glyphicons 未显示在 Grails GSP 页面中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24120027/