且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

将空数字转换为null

更新时间:2023-10-15 08:49:46

不,我无法使用vm参数:-Dorg.apache.el.parser.COERCE_TO_ZERO = false

问题出在服务器使用的EL实现中,而不是JSF中.您确实需要使用VM参数.如果您不能使用它,则只能通过将Tomcat降级到6.0.15或更早版本,或者用例如Glassfish替换服务器来解决您的问题.引入改进的" EL强制行为是Tomcat 6.0.16.

The problem is in EL implementation used by the server, not in JSF. You really need to use the VM argument. If you can't use it then your problem can't be solved by other way than downgrading Tomcat to 6.0.15 or older, or replacing the server by for example Glassfish. It was Tomcat 6.0.16 when this "improved" EL coercion behaviour was introduced.

如果您详细说明了无法使用它的确切原因(这对我来说至少没有意义),那么我们也许可以提出如何真正使用它的方法.例如,如果不了解如何设置VM参数,请这样说.或者,如果由于它是由第三方维护的服务器而不允许您将VM参数添加到启动脚本中,请这样说.这两个问题都可以解决,因此您可以正确使用VM参数.

If you elaborate the exact reason why you can't use it (it makes at least no sense to me), then we may be able to propose ways how to really use it. For example, if it's ignorance how to set a VM argument, then say so. Or if you're not allowed to add a VM argument to startup script because it's a 3rd party maintained server, then say so. Both problems can be solved so that you can use the VM argument rightly.