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

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

    javax.faces.INTERPRET_EMPTY_STRING_SUBMITTED_VALUES_AS_NULL
    true         


        
5条回答
  •  日久生厌
    2020-11-30 12:25

    The sample codes obj condition checking is wrong. At update model phase, the obj is passed at null. After correct to the code below, my custom ELResolver works.

     @Override
    public Object convertToType(final ELContext context, final Object obj, final Class targetType) {
        if (obj == null && String.class.equals(targetType)) {
            context.setPropertyResolved(true);
        }
        return null;
    }
    

提交回复
热议问题