[#JAVASERVERFACES-2067] RI checks context parameters only

advertisement
[JAVASERVERFACES-2067] RI checks context parameters only with lower
case "true" Created: 18/May/11 Updated: 11/Feb/14 Resolved: 20/Feb/12
Status:
Project:
Component/s:
Affects
Version/s:
Fix Version/s:
Closed
javaserverfaces
None
2.1.0
Type:
Reporter:
Resolution:
Labels:
Remaining
Estimate:
Time Spent:
Original
Estimate:
Bug
xj
Fixed
None
Not Specified
Attachments:
changebundle-2067-1.txt
changebundle-2067.txt
Issue Links:
Related
is related JAVASERVERFACESto
3177
2.1.2, 2.2.0-m01
Priority:
Assignee:
Votes:
Major
rogerk
0
Not Specified
Not Specified
changebundle-2067-2.txt
Migrate test for issue 2067 to Closed
test/a...
Description
This is reported against Mojarra-2.1.0.
In 11.1.3 Application Configuration Parameters of JSF 2.0 specification, it says that context
parameters of boolean type should be evaluated with toLowerCase().equals("true"). RI only
uses lower case "true" to check, is it correct?
Comments
Comment by rogerk [ 19/May/11 ]
Yes I think this ok. I don't think the spec is implying that an implementation has to "literally"
use toLowerCase().equals("true"). The fact that Mojarra is set up so as to enforce that the
boolean values match either true|false is fine.
The way Mojarra does it is better for performance.
Perhaps there could be a spec clarification on this?
Comment by xj [ 20/May/11 ]
Please let me clarify this issue more clearly. We think the implementation should check value
regardless of upper case or lower case.
com.sun.faces.config.WebConfiguration#isValueValid:
----->
if (!ALLOWABLE_BOOLEANS.matcher(value).matches()) {
if (LOGGER.isLoggable(Level.WARNING)) {
LOGGER.log(Level.WARNING,
"jsf.config.webconfig.boolconfig.invalidvalue",
new Object[]
{ value, param.getQualifiedName(), "true|false" }
);
}
return false;
}
return true;
<----The above source code will return true if the "value" is "true".
However, ALLOWABLE_BOOLEANS.matcher("True").matches() will give a "false" result.
This let the following code select default value.
WebConfiguration#processBooleanParameters
----->
if (alternate != null) {
if (isValueValid(param, strValue))
{ value = Boolean.valueOf(strValue); }
else
{ value = param.getDefaultValue(); }
<----Comment by rogerk [ 20/May/11 ]
So - if I am understanding you correctly - you are saying that in web.xml for example, valid
values could be:
<context-param>
<param-name>com.sun.faces.validateXml</param-name>
<param-value>true</param-value>
</context-param>
or
<context-param>
<param-name>com.sun.faces.validateXml</param-name>
<param-value>=True</param-value>
</context-param>
same for "false" or "False",..
If so, what does that buy you? true|false are consistent with java boolean values...
Am I missing somehting here?
Comment by rogerk [ 20/May/11 ]
Never mind - I think I see your point w/r/t the specification.
I'll take a look..
Comment by rogerk [ 23/May/11 ]
Reopening.
Comment by rogerk [ 23/May/11 ]
changes.
Comment by ioss [ 23/May/11 ]
I suggest using:
Pattern.compile("true|false", Pattern.CASE_INSENSITIVE)
to also match for FAlse or truE (as required by the specification)
The testcase should better test for a stranger input like "FalSe" instead of "False".
Comment by rogerk [ 23/May/11 ]
Revised change bundle on the way..
Comment by rogerk [ 23/May/11 ]
Revised change bundle.
Comment by rogerk [ 23/May/11 ]
Revised change bundle (again)...
Comment by ioss [ 23/May/11 ]
r=ioss
Comment by rogerk [ 23/May/11 ]
Committed to trunk:
Sending jsf-ri/src/main/java/com/sun/faces/config/WebConfiguration.java
Adding jsf-test/
Adding jsf-test//build.xml
Adding jsf-test//htmlunit
Adding jsf-test//htmlunit/pom.xml
Adding jsf-test//htmlunit/src
Adding jsf-test//htmlunit/src/main
Adding jsf-test//htmlunit/src/main/java
Adding jsf-test//htmlunit/src/main/java/com
Adding jsf-test//htmlunit/src/main/java/com/sun
Adding jsf-test//htmlunit/src/main/java/com/sun/faces
Adding jsf-test//htmlunit/src/main/java/com/sun/faces/systest
Adding jsf-test//htmlunit/src/main/java/com/sun/faces/systest/Issue2067TestCase.java
Adding jsf-test//i_jsf_2067
Adding jsf-test//i_jsf_2067/pom.xml
Adding jsf-test//i_jsf_2067/src
Adding jsf-test//i_jsf_2067/src/main
Adding jsf-test//i_jsf_2067/src/main/webapp
Adding jsf-test//i_jsf_2067/src/main/webapp/WEB-INF
Adding jsf-test//i_jsf_2067/src/main/webapp/WEB-INF/web.xml
Adding jsf-test//i_jsf_2067/src/main/webapp/index.xhtml
Sending jsf-test/build.xml
Transmitting file data ........
Committed revision 9079.
Comment by rogerk [ 23/May/11 ]
Committed. Will commit to 2.1.X branch as well.
Comment by rogerk [ 23/May/11 ]
Committed to MOJARRA_2_1_X_ROLLING branch:
Sending jsf-ri/src/main/java/com/sun/faces/config/WebConfiguration.java
Adding jsf-test/
Adding jsf-test//build.xml
Adding jsf-test//htmlunit
Adding jsf-test//htmlunit/pom.xml
Adding jsf-test//htmlunit/src
Adding jsf-test//htmlunit/src/main
Adding jsf-test//htmlunit/src/main/java
Adding jsf-test//htmlunit/src/main/java/com
Adding jsf-test//htmlunit/src/main/java/com/sun
Adding jsf-test//htmlunit/src/main/java/com/sun/faces
Adding jsf-test//htmlunit/src/main/java/com/sun/faces/systest
Adding jsf-test//htmlunit/src/main/java/com/sun/faces/systest/Issue2067TestCase.java
Adding jsf-test//i_jsf_2067
Adding jsf-test//i_jsf_2067/pom.xml
Adding jsf-test//i_jsf_2067/src
Adding jsf-test//i_jsf_2067/src/main
Adding jsf-test//i_jsf_2067/src/main/webapp
Adding jsf-test//i_jsf_2067/src/main/webapp/WEB-INF
Adding jsf-test//i_jsf_2067/src/main/webapp/WEB-INF/web.xml
Adding jsf-test//i_jsf_2067/src/main/webapp/index.xhtml
Sending jsf-test/build.xml
Transmitting file data ........
Committed revision 9080.
Change bundle is the same as trunk except for jsf-test/build.xml due to the fact that there were
fewer tests.
Comment by rogerk [ 27/May/11 ]
reopen to edit fix version
Comment by rogerk [ 27/May/11 ]
fix version
Comment by rogerk [ 27/May/11 ]
re-closing
Generated at Fri Feb 05 11:22:45 UTC 2016 using JIRA 6.2.3#6260sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.
Download