You can configure JSF 2.x to interpret empty submitted values as null by the following context-param in web.xml:
<context-param>
<param-name>javax.faces.INTERPRET_EMPTY_STRING_SUBMITTED_VALUES_AS_NULL</param-name>
<param-value>true</param-value>
</context-param>
Here is a long explanation. Section 11.1.3 of the JSF spec says:
javax.faces.INTERPRET_EMPTY_STRING_SUBMITTED_VALUES_AS_NULL -- If this param is set, and
calling toLowerCase().equals("true") on a String representation of its value returns true, any
implementation of UIInput.validate() must take the following additional action.
If the javax.faces.INTERPRET_EMPTY_STRING_SUBMITTED_VALUES_AS_NULL context parameter value is
true (ignoring case), and UIInput.getSubmittedValue() returns a zero-length String call
UIInput.setSubmittedValue(null) and continue processing using null as the current submitted value.
This is indeed being done. However, when UIInput.updateModel() is called, that triggers the EL Evaluation, which will coerce the value based on its expected type. If it sees that the expected type is a String then it will convert a null to empty string. So eventually, your managed bean will be set with empty string instead of null. That behavior is governed by the EL spec.
相关推荐
java.lang.NumberFormatException For inputstring 4294967295处理方法
Caused by: java.lang.IllegalArgumentException: input == null! at javax.imageio.ImageIO.read(ImageIO.java:1388) at com.pleanwar.fiying.FlyingObject.loadImage(FlyingObject.java:52) at ...
Write a program called String1.java ... Create a String object that accepts input from the user. Referencing the JDK docs, execute 2 different methods on the String. Print the results of the methods
Python基础语法-菜鸟教程-函数⽤法:input()和raw_input() 1.input()和raw_input()⽤法 (1).input() 1)⽤法解释 def input(*args, **kwargs): # real signature unknown """ Read a string from standard input....
附件解决dbf读取文件时遇到乱码问题,下载下来可以直接使用,无需使用dbf的jar包了,可以直接使用.
C#编程 WinForm窗体开发 InputText(源码)C#编程 WinForm窗体开发 InputText(源码)C#编程 WinForm窗体开发 InputText(源码)C#编程 WinForm窗体开发 InputText(源码)C#编程 WinForm窗体开发 InputText(源码)C#编程 ...
cstdlib 的描述文档 * <assert.h> : Diagnostics * <ctype.h> : Character Class Tests * <errno.h> : Error Codes Reported by (Some) ... * <string.h> : String functions * <time.h> : Time and Date functions
Create a String object that accepts input from the user. Referencing the JDK docs, execute 2 different methods on the String. Print the results of the methods. Result: Input a string: How are you ...
英文版C语言标准库,Word文档 Contents • <assert.h> : Diagnostics • <ctype.h> : Character Class Tests • <errno.h> : Error Codes ...• <string.h> : String functions • <time.h> : Time and Date functions
Find an efficient algorithm that examines a string of these symbols, say bbbbac, and decides whether or not it is possible to parenthesize the string in such a way that the value of the resulting ...
在数据结构中如何对图进行遍历操作,如何利用图的遍历来解决问题
本文实例讲述了jQuery中:input选择器用法。分享给大家供大家参考。具体分析如下: 此选择器匹配所有的input元素。例如:<input type=”text” />等等 语法结构: 代码如下:$(“:input”) 实例代码: 代码如下:...
idea连接达梦数据库出现input string "8"问题,驱动已修复,里面包含修复的源码,如果涉及其他版本,参照修改即可
3: public void Connect(string connectionName, string user, string pass) 4: { 5: string arg = string.Format("rasdial \"{0}\" {1} {2}", connectionName, user, pass); 6: InvokeCmd(arg); 7: } 8: 9: ...
上线后报一堆这样的错:iconv() : Detected an illegal character in input string考虑到GB2312字符集比较小,换个大的吧,于是改成GBK:$str = iconv(‘UTF-8’, ‘GBK’, unescape(isset($_GET[‘str’])?...
Input: text = "nlaebolko" Output: 1 Example 2: Input: text = "loonbalxballpoon" Output: 2 Example 3: Input: text = "leetcode" Output: 0 约束: 1 <= 文本长度 <= 10^4 文本仅由小写英文字母组成。 ...
文件转换(inputString)请勿乱下载
..\SYSTEM\sys\sys.h(3): error: #5: cannot open source input file "stm32f10x_lib.h": No such file or directory compiling delay.c... ..\SYSTEM\delay\delay.c(1): error: #5: cannot open source input file ...
jquery input text文本框模拟select框美化 jquery input text文本框模拟select框美化 jquery input text文本框模拟select框美化 jquery input text文本框模拟select框美化
2. The String.Format(“Input = {0} and Output = {1}”, “1”,”2”) expression returns which of the following text: 3. How can a string variable called myString be converted to an all-capitals ...