【发布时间】:2013-10-15 06:02:58
【问题描述】:
我有一个 JSF 2.0 应用程序,其中每个页面都存储在数据库的 cms_page 表中。该表具有 PK 列 cms_page_id 和 URL 列(其中包含 SEO 友好的 URL)。
当我显示一个页面时,有一个名为“关于我们”的链接,其 URL 为“/com/aboutus.html” 这在我的 XHTML 文件中显示为: #{cmsPage.cmsPageUrlName}/>
渲染
<a href="/com/aboutus.html">About Us</a>
据我所知,h:outputLink 不能用于触发支持 bean 中的任何方法。 我不能使用 h:commandLink,因为当您将鼠标悬停在链接上时,它不会显示“/com/aboutus.html” URL。我不知道如何触发支持 bean 方法来导航到下一页。 关于我们的链接实际上会指向 /faces/pages.xhtml,但会使用 PrettyFaces 来显示“/com/aboutus.html” URL
另外,如果我直接访问 URL www.test.com/com/aboutus.html,我会做什么?
此 URL 不存在,实际 URL 为 www.test.com/faces/pages.xhtml?url=%2Fcom%2Faboutus.html
我是否应该考虑设置 PrettyFaces 来完成所有工作?
【问题讨论】:
标签: jsf