javax.faces.INTERPRET_EMPTY_STRING_SUBMITTED_VALUES_AS_NULL does not work anymore since Java EE 7 / EL 3.0

前端 未结 5 2204
遥遥无期
遥遥无期 2020-11-30 12:07

    javax.faces.INTERPRET_EMPTY_STRING_SUBMITTED_VALUES_AS_NULL
    true         


        
5条回答
  •  离开以前
    2020-11-30 12:29

    We tested all Oracle EL 2.2.2, 3.0.0, 3.0.1-b0X[1-8] and with Apache Jasper EL 3.0 in Tomcat 7.0.xx or Tomcat 8.0.30 using or not custom ELResolver Wrapper with ELResolver fixed @ faces-config.xml level.

    The result is the same. String MethodExpression null is interpreted as EMPTY String ""

    Calling from EL the following methods with t=null;

    Case 1

    public final void checkObject(Object t) 
    ...
    #{myBean.checkObject(null)} -> Receive null (OK)
    

    Case 2

    public final void checkString(String t) 
    ...
    #{myBean.checkString(null)} -> Receive EMPTY String "" (NOT OK)
    

    Case 3

    public final void checkDouble(double t) 
    ...
    #{myBean.checkDouble(null)} -> Receive 0.0 (OK)
    

    Case 4

    public final void checkBigDecimal(BigDecimal t) 
    ...
    #{myBean.checkBigDecimal(null)} -> Receive null (OK) 
    

提交回复
热议问题