- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
由于所有 JSP 在执行之前都会生成/转换为 Servlet,因此 Facelets 也是如此吗?
我正在使用 JSF 2.0 和 Facelets,并希望看到它生成的 Java 代码,它可能是 Servlet。
最佳答案
不,Facelets 文件使用 SAX parser 解析为 XML 树。 . XML 树存储在 Facelet cache 中. XML 树在 view build time 期间变成了 UIComponent
可通过 FacesContext#getViewRoot()
访问的树(您可以在运行时通过 getChildren()
遍历)。组件树通常由自己生成 HTML 代码 encodeXxx()
方法或相关联的方法 Renderer
,以 UIViewRoot#encodeAll()
开头.
Facelets 文件 不要生成任何类文件。 XML 树默认存储在服务器的内存中。但是,从 JSF 2.1 开始,您可以指定自定义 FaceletCache
实现者 <facelet-cache-factory>
在 faces-config.xml
您可以在其中编写代码以将 XML 树存储在例如磁盘文件系统上(虽然这会更慢)。
如果您使用 <ui:debug>
在 View 中打开,可以看到UIViewRoot
后面的组件树的文字表示.另见 how to debug JSF/EL
也可以看看:
关于jsf - Facelets页面是否像JSP生成给Servlet那样生成给Servlet,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13173633/
我有多个模板,它们之间的区别仅在于几个容器。最复杂的一个包含所有其他容器中使用的所有容器的超集,因此为了避免创建多个模板,我按以下格式创建了最复杂的一个 some layout stuff (di
有没有办法将 html 文件的内容插入到 Facelet 模板中? Facelets 标记将不起作用,因为它仅用于包含 Facelet 内容。 换句话说,我正在寻找等同于 JSP include 指令
我有一个用 JSP 编码的应用程序,现在我们正在将页面迁移到 Facelets。 我们的 PhaseListeners 之一正在操作组件树,因为它需要找出树中的一些组件并提取其中的一些值。但是对于 F
我已经读了好几遍了:一些开发人员不提倡在他们的 XHTML 文件中将 JSF/Facelets 标签与 HTML 标签交织在一起。显然 HTML 标签不会成为 UI 组件树的一部分,但这样做的缺点是什
我正在使用 JSF 2.0 构建一个 Web 应用程序,并且在我的 WEB-INF > lib 文件夹中有一个 jaf-facelets.1.1.10 jar,所以现在我正在尝试删除它,以便我可以使用
我正在使用 Apache MyFaces Commons Validator标签库。 我应该如何将它添加到我的 web.xml 中?通过Maven下载和解析commons JAR。 XHTML(我认为
我正在尝试使用 Facelets 创建自定义标签,但它没有呈现(即标签在响应中显示为未替换)。 标签(/WEB-INF/facelets/tags/inputThumbnailSelector.xht
当我的页面无法正确呈现时,我会在 jboss 控制台中看到此信息。有谁知道这是什么意思? 14:22:46,403 INFO [facelet] Facelet[/layout/header.xht
有人知道如何获取 ui:repeat Facelets 标记中元素的索引吗? 最佳答案 指定“varStatus”属性的值: 然后您可以通过 EL 访问循环索引: #{myVarSta
我在使用 Facelets 中的自定义组件时遇到问题。第一次呈现页面时,会在组件类上正确设置属性。但是,当提交表单时,不会设置属性。 这是我用来测试这个的类。 public class TestEch
我在 Tomcat 中使用 JSF 2 和 RichFaces。我是初学者,正在试用我找到的页面 here ,但页面只是空白(未呈现内容)。我尝试添加 Facelets 1.1 库,页面呈现没有问题。
我在我的应用程序中大量使用 bundle 的属性,因为我努力在未来保持代码的可维护性。因此,所有 HTML 文本都是从键/值属性文件中获取的,例如。 'index_en.properties' 当我需
我正在尝试将 Facelets 与 MyFaces 1.2 一起使用。看起来 Facelets 下载地址为 http://facelets.dev.java.net不复存在。 有谁知道 1) 我在哪里
在 Eclipse (Helios) 中打开 JSF 页面(JSF + Apache Trinidad + facelet)时,Eclipse 在页面打开前会卡住几秒钟。 同样在编辑页面时,代码完成/
有没有办法在构建或部署过程中检查您的 Facelets 文件是否有错误? 我不是在寻找一种解决方案,它不仅可以根据架构验证 Facelets 文件,还可以验证 EL 表达式是否有效。例如,如果属性或方
我有一个包含 8 列的 JSF 数据表。最后 4 列是数值列。可以说我的数据表带来了 20 行结果。我想添加最后一行,它只包含最后 4 列的字段并包含 20 行对应值的总和。我想用 Facelets
我想在另一个模板中使用 Facelets 模板。目前我有一个“基本”模板,到目前为止已经足够我完成的所有页面。它有一个顶部和一个内容区域。 顶部具有 Logo 、菜单、登录/注销功能,而内容区域则显示
我有一个使用组合的应用程序(用于页面模板)。但是我们认为在创建一个 web 应用程序( war )来托管所有应用程序共享的所有应用程序的所有模板。 如何包含来自其他上下文的模板?此时我使用从 http
我有一个对象列表,其中我不知道有多少,也不知道将调用哪些属性。我可以创建一个数据表来在不同的列中显示所有对象的属性吗? 我在想类似的事情: "#{object.attribu
使用 Facelets 时,我在导航方面遇到了一些问题。 我在 /WEB-INF 中有我的主模板: Header
我是一名优秀的程序员,十分优秀!