MyFaces中的开发和生产有什么区别 [英] What's the difference between Development and Production in MyFaces

查看:92
本文介绍了MyFaces中的开发和生产有什么区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用MyFaces在JSF中进行一些开发工作,并且收到此警告.

I'm doing some development work in JSF with MyFaces and I got this warning.

*******************************************************************
*** WARNING: Apache MyFaces-2 is running in DEVELOPMENT mode.   ***
***                                         ^^^^^^^^^^^         ***
*** Do NOT deploy to your live server(s) without changing this. ***
*** See Application#getProjectStage() for more information.     ***
*******************************************************************

开发和生产模式之间有什么区别?有安全隐患吗?仅仅是性能增强吗?

What is the difference between development and production mode? Are there security risks? Is it just performance enhancements?

推荐答案

没有安全风险,但是会影响性能.在将项目阶段设置为开发阶段时,将更多地记录日志并减少其缓存.

There are no security risks, there are however performance implications. When project stage is set to development, then there will more often be logged and less be cached.

关于日志记录,将记录有关如何构建和呈现组件的其他调试信息.例如,如果您有一个<h:inputText>而没有任何父级<h:form>,那么它将被记录并显示为面部消息.无论如何,所有未在<h:message(s)>组件中显示的排队的脸部消息都将在页面底部的单独消息列表中以橙色警告字体显示,表示未显示"消息.此外,异常处理也有所不同,MyFaces会代替<error-page>显示丰富的错误页面,其中包括有关组件树和范围变量的详细信息.

With regard to logging, additional debug information about how components are built and rendered will be logged. For example, if you have a <h:inputText> without any parent <h:form>, then this will be logged and displayed as a faces message. All queued faces messages which are not displayed in any of <h:message(s)> components will be displayed anyway in a separate message list at the bottom of the page, with an orange warning font, indicating "undisplayed" messages. Also, the exception handling is different, MyFaces will instead of the <error-page> show a rich error page including detail about the component tree and scoped variables.

关于缓存,Facelet缓存将更定期地刷新.因此,如果您在Facelet文件中进行更改并按F5,则更改将立即"反映出来.在生产阶段并非如此,您基本上需要重新启动整个服务器.

With regard to caching, the Facelet cache will refresh more regularly. So if you make changes in a Facelet file and press F5, then the changes will "immediately" be reflected. This is not true for production stage, you'd basically need to restart the whole server.

jsf.js JavaScript文件还将显示为未缩小的版本,从而可以在Web浏览器中更轻松地进行JS调试.在生产阶段,它是缩小版本,因此体积更小,投放速度更快,但完全不可读.

Also the jsf.js JavaScript file will show up as the unminified version, allowing easier JS debugging in the webbrowser. In production stage, it's instead the minified version, which is thus smaller and faster to serve, but it is completely unreadable.

Mojarra的行为与之相似,但应该提供丰富的错误页面.

Mojarra has much similar behaviour, expect of the rich error page.

这篇关于MyFaces中的开发和生产有什么区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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