Skip to content
This repository has been archived by the owner on Sep 5, 2023. It is now read-only.

behavior issues with "INTERPRET_EMPTY_STRING_SUBMITTED_VALUES_AS_NULL" setting #671

Closed
glassfishrobot opened this issue Nov 16, 2009 · 21 comments

Comments

@glassfishrobot
Copy link

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...

Environment

Operating System: All
Platform: All

Affected Versions

[2.0]

@glassfishrobot
Copy link
Author

Reported by mwessendorf@java.net

@glassfishrobot
Copy link
Author

@edburns said:
Prepare to delete api subcomponent

@glassfishrobot
Copy link
Author

mojavelinux said:
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.

@glassfishrobot
Copy link
Author

mojavelinux said:
Updating target milestone and subcomponent.

@glassfishrobot
Copy link
Author

@edburns said:
cat1

@glassfishrobot
Copy link
Author

@edburns said:
frame

@glassfishrobot
Copy link
Author

@edburns said:
These are valid 2.0 Rev a issues

@glassfishrobot
Copy link
Author

@edburns said:
take ownership.

@glassfishrobot
Copy link
Author

@edburns said:
Behavior change, move to 2.1.

@glassfishrobot
Copy link
Author

@edburns said:
Change target milestone.

@glassfishrobot
Copy link
Author

rogerk said:
triage

@glassfishrobot
Copy link
Author

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

@glassfishrobot
Copy link
Author

@manfredriem said:
Setting priority to Major

@glassfishrobot
Copy link
Author

@edburns said:

<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> }

@glassfishrobot
Copy link
Author

@glassfishrobot
Copy link
Author

@BalusC said:
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

@glassfishrobot
Copy link
Author

Marked as fixed on Monday, May 30th 2016, 6:13:45 am

@glassfishrobot
Copy link
Author

This issue was imported from java.net JIRA JAVASERVERFACES_SPEC_PUBLIC-671

@tandraschko
Copy link

@BalusC / @arjantijms / @edburns
This issue has assigned 2.3 as milestone but still not fixed, right?
We currently discuss this is in the MyFaces community if we should add a flag to MyFaces, to control this behavior.
Maybe we could also agree on spec level?
Please see: https://issues.apache.org/jira/browse/MYFACES-3525

@arjantijms
Copy link
Member

@tandraschko

Didn't javaserverfaces/mojarra@0813ee1 fix the issue?

@tandraschko
Copy link

@arjantijms
Oh i see, Mojarra 2.3 behaves different now. Maybe i tried with 2.2 in the past.
The value is always blank if invalid, doesn't matter if "javax.faces.INTERPRET_EMPTY_STRING_SUBMITTED_VALUES_AS_NULL" is true or false.

Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants