简体   繁体   English

JSF Facelets和Servlet API?

[英]JSF Facelets and Servlet API?

Someone today tried to convince me that Facelets are built on top of Servlet API. 今天有人试图说服我Facelets建立在Servlet API之上。 Knowing that Facelets unlike JSP are never compiled to actual servlet Java classes, I'm wondering how that could be possible. 知道与JSP不同的Facelets从未被编译为实际的servlet Java类,我想知道这怎么可能。 If this happens then at what stage Servlet API abstract classes and interfaces get implemented? 如果发生这种情况,那么在什么阶段实现Servlet API抽象类和接口?

Do you know the difference between API and implementation? 您知道API和实现之间的区别吗? The Servlet API may be full of abstract classes and interfaces, but the servlet implementation is not. Servlet API可能充满了抽象类和接口,但Servlet实现却没有。

JSF has a FacesServlet which processes JSF related things, so yeah it's definitely built on top of the Servlet API . JSF有一个FacesServlet来处理与JSF相关的事情,因此,它肯定是建立在Servlet API之上的。

Note that Facelets is actually the advanced templating system used with JSF (instead of using JSP ), so I wouldn't say that Facelets is built on top of Servlets , but JSF is. 请注意, Facelets实际上是与JSF使用的高级模板系统(而不是使用JSP ),因此我不会说Facelets建立在Servlets之上,而JSF是。

The facelets aren't compiled to a Servlet or any other Java class instance. 这些方面未编译为Servlet或任何其他Java类实例。 They are converted to a XML tree, which is then stored in an instance of the FaceletCache class. 它们被转换为XML树,然后存储在FaceletCache类的实例中。

More info: 更多信息:

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM