javaserverfaces-spec-public
  1. javaserverfaces-spec-public
  2. JAVASERVERFACES_SPEC_PUBLIC-671

behavior issues with "INTERPRET_EMPTY_STRING_SUBMITTED_VALUES_AS_NULL" setting

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0
    • Fix Version/s: 2.3
    • Component/s: Validation/Conversion
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      671
    • Status Whiteboard:
      Hide

      cat1 frame size_small importance_medium

      Show
      cat1 frame size_small importance_medium

      Description

      This impl bug was filed:
      https://java.net/jira/browse/JAVASERVERFACES-1375

      as there are some issues in handling empty string validation...

      Now, the fix is in; and most-likely the behavior of the alogrithm needs to be
      updated in the spec as well. Additionally there should be java doc which
      explains the change...

        Activity

        Hide
        Ed Burns added a comment -

        Prepare to delete api subcomponent

        Show
        Ed Burns added a comment - Prepare to delete api subcomponent
        Hide
        mojavelinux added a comment -

        Looking at the scenario cited in the impl issue report, the problem I see is
        that the assignment of a "blank" value should not be disabled when
        INTERPRET_EMPTY_STRING_SUBMITTED_VALUES_AS_NULL is enabled. But that is likely
        happening because prior to this feature, a null value was interpreted as "no
        assignment necessary".

        The resolution I see is that if the request parameter is missing or empty, then
        a null value needs to overwrite any previous value on the component. After all,
        that is what is meant by INTERPRET_EMPTY_STRING_SUBMITTED_VALUES_AS_NULL.

        Show
        mojavelinux added a comment - Looking at the scenario cited in the impl issue report, the problem I see is that the assignment of a "blank" value should not be disabled when INTERPRET_EMPTY_STRING_SUBMITTED_VALUES_AS_NULL is enabled. But that is likely happening because prior to this feature, a null value was interpreted as "no assignment necessary". The resolution I see is that if the request parameter is missing or empty, then a null value needs to overwrite any previous value on the component. After all, that is what is meant by INTERPRET_EMPTY_STRING_SUBMITTED_VALUES_AS_NULL.
        Hide
        mojavelinux added a comment -

        Updating target milestone and subcomponent.

        Show
        mojavelinux added a comment - Updating target milestone and subcomponent.
        Hide
        Ed Burns added a comment -

        cat1

        Show
        Ed Burns added a comment - cat1
        Hide
        Ed Burns added a comment -

        frame

        Show
        Ed Burns added a comment - frame
        Hide
        Ed Burns added a comment -

        These are valid 2.0 Rev a issues

        Show
        Ed Burns added a comment - These are valid 2.0 Rev a issues
        Hide
        Ed Burns added a comment -

        take ownership.

        Show
        Ed Burns added a comment - take ownership.
        Hide
        Ed Burns added a comment -

        Behavior change, move to 2.1.

        Show
        Ed Burns added a comment - Behavior change, move to 2.1.
        Hide
        Ed Burns added a comment -

        Change target milestone.

        Show
        Ed Burns added a comment - Change target milestone.
        Hide
        rogerk added a comment -

        triage

        Show
        rogerk added a comment - triage
        Hide
        Ed Burns added a comment -

        Set priority to baseline ahead of JSF 2.3 triage. Priorities will be assigned accurately after this exercise.

        Show
        Ed Burns added a comment - Set priority to baseline ahead of JSF 2.3 triage. Priorities will be assigned accurately after this exercise.
        Hide
        Manfred Riem added a comment -

        Setting priority to Major

        Show
        Manfred Riem added a comment - Setting priority to Major
        Hide
        Ed Burns added a comment -
        <os890> well what worked in the past is:
        <os890> public class FixedHtmlInputText extends HtmlInputText {
        <os890>     @Override
        <os890>     public void validate(FacesContext context) {
        <os890>         Object submittedValue = getSubmittedValue();
        <os890>         try {
        <os890>             super.validate(context);
        <os890>         } finally {
        <os890>             if (!isValid()) {
        <os890>                 setSubmittedValue(submittedValue);
        <os890>             }
        <os890>         }
        <os890>     }
        <os890> }
        
        Show
        Ed Burns added a comment - <os890> well what worked in the past is: <os890> public class FixedHtmlInputText extends HtmlInputText { <os890> @Override <os890> public void validate(FacesContext context) { <os890> Object submittedValue = getSubmittedValue(); <os890> try { <os890> super .validate(context); <os890> } finally { <os890> if (!isValid()) { <os890> setSubmittedValue(submittedValue); <os890> } <os890> } <os890> } <os890> }
        Hide
        balusc added a comment -
        Show
        balusc added a comment - Related: https://java.net/jira/browse/JAVASERVERFACES-2262
        Hide
        balusc added a comment -

        EditableValueHolder#getSubmittedValue() javadoc already says

        The action taken based on whether the value is null, empty, or
        non-null is determined based on the value of the javax.faces.INTERPRET_EMPTY_STRING_SUBMITTED_VALUES_AS_NULL context-param.

        The UIInput implementation never considered that. I have therefore applied the fix as proposed in https://java.net/jira/browse/JAVASERVERFACES-2262?focusedCommentId=340126#comment-340126 without any necessary spec changes.

        https://java.net/projects/mojarra/sources/git/revision/0813ee1fdef418e47ef03ced7d57a1abe4c2bf54

        Show
        balusc added a comment - EditableValueHolder#getSubmittedValue() javadoc already says The action taken based on whether the value is null , empty, or non- null is determined based on the value of the javax.faces.INTERPRET_EMPTY_STRING_SUBMITTED_VALUES_AS_NULL context-param. The UIInput implementation never considered that. I have therefore applied the fix as proposed in https://java.net/jira/browse/JAVASERVERFACES-2262?focusedCommentId=340126#comment-340126 without any necessary spec changes. https://java.net/projects/mojarra/sources/git/revision/0813ee1fdef418e47ef03ced7d57a1abe4c2bf54

          People

          • Assignee:
            balusc
            Reporter:
            mwessendorf
          • Votes:
            5 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: