Bootsfaces页面在浏览器中显示,没有任何样式 [英] Bootsfaces page shows up in browser without any styling

查看:102
本文介绍了Bootsfaces页面在浏览器中显示,没有任何样式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在Tomcat上运行的eclipse中创建了一个简单的JSF项目,我尝试在/WEB-INF/lib中包含Bootsfaces jar,并在xhtml页面中包含标签(如Bootsfaces入门页面中所示),但是似乎不起作用,我只是得到没有任何样式的文本.

I have created a simple JSF project in eclipse running on Tomcat, I tried including the Bootsfaces jar in /WEB-INF/lib and including the tags in my xhtml page (as shown in the Bootsfaces getting started page) ,but that does not seem to be work, I simply get the text without any styling.

推荐答案

对此我们遇到了很多麻烦.我怀疑这是以前的BootsFaces版本中HeadRenderer的错误.我们已经在BootsFaces 0.6.5中用另一种解决方案替换了令人反感的类.

We've had a lot of trouble with this. I suspect it was the fault of the HeadRenderer in former BootsFaces versions. We've replaced the offending class by a different solution in BootsFaces 0.6.5.

如果问题仍然存在,请尝试以下操作:

If the problem still persists, try this:

  1. 确保已添加<h:head></h:head>标记(即使该标记为空).请勿使用HTML标记(<head />).
  2. 检查web.xml的URL模式.许多教程建议将JSF文件放入虚拟文件夹,例如<url-pattern>/pages/</url-pattern>.不要那样做像```* .jsf这样的简单模式没有什么错.顺便说一下,这是默认设置,因此您可以安全地完全省略url-pattern.
  3. 如果失败,请添加OmniFaces的CombinedResourceHandler或BootsFaces的UnmappedResourceHandler. (据我所知,该实现与其OmniFaces对应版本几乎相同,因此您也可以使用OmniFaces版本-但我没有对其进行测试.)
  4. 在浏览器中检查URL.也许您输入的是localhost:8080/index.xthml而不是localhost:8080/index.jsf?
  5. 如果仍然遇到问题,请在BootsFaces GitHub存储库上打开一个问题( https://github.com/TheCoder4eu/BootsFaces-OSP/issues ).但首先阅读 https://github.com/TheCoder4eu/BootsFaces-OSP/issues/157 -也许已经解决了您的问题.
  1. Make sure you've added a <h:head></h:head> tag (even if it's empty). Do not use the HTML tag (<head />).
  2. Check the URL pattern of the web.xml. Many tutorial recommend to put the JSF files into a virtual folder, such as <url-pattern>/pages/</url-pattern> . Don't do that. There's nothing wrong with simple patterns like ```*.jsf. By the way, this is the default, so you can safely omit the url-pattern altogether.
  3. If that fails, add the CombinedResourceHandler of OmniFaces or the UnmappedResourceHandler of BootsFaces. (As far as I know, that's almost the same implementation as its OmniFaces counterpart, so you can use the OmniFaces version as well - but I didn't test it).
  4. Check the URL in your browser. Maybe you entered localhost:8080/index.xthml instead of localhost:8080/index.jsf?
  5. If you're still stuck, open an issue on the BootsFaces GitHub repository (https://github.com/TheCoder4eu/BootsFaces-OSP/issues). But first read https://github.com/TheCoder4eu/BootsFaces-OSP/issues/157 - maybe that already solves your problem.

这篇关于Bootsfaces页面在浏览器中显示,没有任何样式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆