JSF(和朋友)标签与传统 html 标签
所以今天这个问题出现了,我没有一个具体或科学的答案。
使用 jsf(或 tomahawk、faclets 等)标签代替传统 html 标签的相关成本是多少?我的直觉反应是,您应该在需要 jsf 标签提供的附加功能的情况下使用它们,而在不需要时使用传统标签。另外,我觉得 jsf 标签比 html 需要更多的资源(因为服务器必须获取它们并将它们重新呈现为 html)。有谁知道实际成本是多少(就时间和内存而言)?另外有用的信息是正在使用的约定是什么,纯 jsf 还是两者的混合?
So this question came up today and I didn't have a specific or scientific answer.
What are the costs associated with using jsf (or tomahawk, faclets, etc., etc.) tags in place of traditional html tags. My gut reaction is that you should use jsf tags in situations where you need the additional functionality they provide, and use traditional tags when you don't. Also I feel like jsf tags would require more resources (since the server has to take them and rerender them as html anyways) than html. Does anybody know what the cost actually is (as far as time and memory)? Also useful information is what is the convention that is in use, pure jsf or a mixture of the two?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
当然是有成本的。这是否明显或可以忽略不计取决于相关服务器的硬件和负载。对其进行分析并在必要时升级服务器。
然而,您应该意识到,另一方面,与在没有基于组件的 MVC 框架的帮助下实现相同的操作相比,您可以节省时间和成本。这将是大量收集参数、进行验证、转换、更新模型值的样板代码,与现有和广泛使用的 MVC 框架相比,这些代码可能编写效率不高。
Sun JSF 开发团队将性能放在首位,并且 Mojarra 已经进行了尽可能的优化。
Sure there is a cost. Whether that is noticeable or negligible depends on the hardware and the load of the server in question. Profile it and upgrade the server if necessary.
You should however realize that on the other hand you save time and cost compared to implementing the same without help of a component based MVC framework. That's going to be a lot of boilerplate code gathering the paramters, doing validations, conversions, updating model values which is possibly not written efficient as compared to existing and widely used MVC frameworks.
The Sun JSF development team puts performance as high priority and Mojarra is already optimized as much as possible.
我们的网站 http://www.skill-guru.com 运行在 JSF/ Tomahawk / Rich faces 上Tomcat 服务器。我们在这里没有看到任何速度问题。
正如杰夫指出的那样,这一切都是经过编译的,因此除非您真的使用了太多丰富的面孔或其他花哨的东西,否则不会有太大的明显差异。
JSF 确实可以帮助您让您的生活变得轻松。
Our site http://www.skill-guru.com runs on JSF/ Tomahawk / Rich faces on a tomcat server. We do not see any speed issues here.
As Jeff pointed out , it all gets compiled so there is not much noticeable difference until and unless you really use too much rich faces or other fancy stuff.
JSF does help you make your life easy.
JSF 页面会根据第一次请求进行编译(如果您在配置中指定,则进行预编译)。因此,不需要每次请求时都需要解析页面。我没有与时间/CPU/内存成本相关的任何具体数字,但我确信它可以忽略不计。
A JSF page gets compiled upon first request (or pre-compiled if you specify that in the config). Thus, it's not like the page needs to be parsed every time it's requested. I don't have any specific numbers relating to time/cpu/memory cost, but I'm sure it's negligible.