我正在尝试在Jboss 5.1 GA上使用Open Sans字体系列,但它返回“资源”META-INF / css / OpenSans-Semibold-webfont.woff'不受支持“。 ttf和svg文件也是如此。
在不同环境下运行的其他JSF项目中,我声明了我的字体:
@font-face {
font-family: 'OpenSansRegular';
src: url("#{resource['fonts/OpenSans-Regular-webfont.eot']}");
src: url("#{resource['fonts/OpenSans-Regular-webfont.eot']}?#iefix") format('embedded-opentype'),
url("#{resource['fonts/OpenSans-Regular-webfont.woff']}") format('woff'),
url("#{resource['fonts/OpenSans-Regular-webfont.ttf']}") format('truetype'),
url("#{resource['fonts/OpenSans-Regular-webfont.svg']}#OpenSansRegular") format('svg');
font-weight: normal;
font-style: normal;
}
web.xml上的Mime类型:
<mime-mapping>
<extension>otf</extension>
<mime-type>font/opentype</mime-type>
</mime-mapping>
<mime-mapping>
<extension>ttf</extension>
<mime-type>application/x-font-ttf</mime-type>
</mime-mapping>
<mime-mapping>
<extension>woff</extension>
<mime-type>application/x-font-woff</mime-type>
</mime-mapping>
<mime-mapping>
<extension>eot</extension>
<mime-type>application/x-font-eot</mime-type>
</mime-mapping>
我之前从未遇到任何关于@ font-face和Jboss的问题,即使使用IE也是如此。我可以通过绝对路径访问JS和图像等其他资源,但是当我尝试浏览字体文件时,它返回403:
Failed to load resource: the server responded with a status of 403 (Forbidden) http://localhost:8080/project/resource/css/OpenSans-Semibold-webfont.woff
Failed to load resource: the server responded with a status of 403 (Forbidden) http://localhost:8080/project/resource/css/OpenSans-Semibold-webfont.ttf
Failed to load resource: the server responded with a status of 403 (Forbidden) http://localhost:8080/project/resource/css/OpenSans-Semibold-webfont.svg#OpenSansSemiBold
Jboss 5.1有任何限制吗?