You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Stephen Friedrich (JIRA)" <de...@myfaces.apache.org> on 2008/08/26 22:40:44 UTC

[jira] Created: (TRINIDAD-1195) Length validator broken if "maximum" attributes is missing

Length validator broken if "maximum" attributes is missing
----------------------------------------------------------

                 Key: TRINIDAD-1195
                 URL: https://issues.apache.org/jira/browse/TRINIDAD-1195
             Project: MyFaces Trinidad
          Issue Type: Bug
    Affects Versions: 1.2.9-core
            Reporter: Stephen Friedrich


<tr:validateLength minimum="2">

Client side validation _always_  results in "Enter 2 or more characters, up to a maximum of 0."
No valid data can be entered at all.

Server side validation works in principal, but spits out an incorrect message when the validation (correctly) fails: "Enter 0 or more characters, not fewer."

See https://issues.apache.org/jira/browse/TRINIDAD-1130 for test.war that you can simply drop into Tomcat 6.

Much of my code omits the "maximum" attribute, because I have a maximum length set on my input components (so that joe user just cannot enter more characters anyway) and have wrapped the form in a seam validation (s:validateAll) that validates on the server side against constraints set with hibernate validation annotations on the entity objects (so that a hacker can do no harm).


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (TRINIDAD-1195) Length validator broken if "maximum" attributes is missing

Posted by "Matthias Weßendorf (JIRA)" <de...@myfaces.apache.org>.
     [ https://issues.apache.org/jira/browse/TRINIDAD-1195?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Matthias Weßendorf resolved TRINIDAD-1195.
------------------------------------------

       Resolution: Fixed
    Fix Version/s: 1.0.10-core
                   1.2.10-core

I saw the problem in 1.2.9;
this is not a problem in 1.2.10

> Length validator broken if "maximum" attributes is missing
> ----------------------------------------------------------
>
>                 Key: TRINIDAD-1195
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-1195
>             Project: MyFaces Trinidad
>          Issue Type: Bug
>    Affects Versions: 1.2.9-core
>            Reporter: Stephen Friedrich
>            Assignee: Matthias Weßendorf
>             Fix For: 1.2.10-core, 1.0.10-core
>
>         Attachments: 0-or-more-not-fewer.png, 2-up-to-a-maximum-of-0.png, confused.PNG
>
>
> <tr:validateLength minimum="2">
> Client side validation _always_  results in "Enter 2 or more characters, up to a maximum of 0."
> No valid data can be entered at all.
> Server side validation works in principal, but spits out an incorrect message when the validation (correctly) fails: "Enter 0 or more characters, not fewer."
> See https://issues.apache.org/jira/browse/TRINIDAD-1130 for test.war that you can simply drop into Tomcat 6.
> Much of my code omits the "maximum" attribute, because I have a maximum length set on my input components (so that joe user just cannot enter more characters anyway) and have wrapped the form in a seam validation (s:validateAll) that validates on the server side against constraints set with hibernate validation annotations on the entity objects (so that a hacker can do no harm).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (TRINIDAD-1195) Length validator broken if "maximum" attributes is missing

Posted by "Matthias Weßendorf (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/TRINIDAD-1195?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12626109#action_12626109 ] 

Matthias Weßendorf commented on TRINIDAD-1195:
----------------------------------------------

I am sorry to say, that I am still (not used your app) able to get the error with the latest greatest Trinidad 1.2.10-SNAPSHOT.

Did a check out of this:
https://svn.apache.org/repos/asf/myfaces/trinidad/trunk_1.2.x/
did the build => mvn install

started the trinidad-demo, using JSF RI 1.2_09
cd trinidad-examples/trinidad-demo
mvn -PjettyConfig -Djsf=ri jetty:run

My page is pretty simple:
<?xml version="1.0" encoding="iso-8859-1" standalone="yes" ?>
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"
          xmlns:f="http://java.sun.com/jsf/core"
          xmlns:tr="http://myfaces.apache.org/trinidad" >
  <jsp:directive.page contentType="text/html;charset=utf-8"/>
  <f:view>
    <tr:document title="Apache Trinidad Demo Index">
       <tr:form>
<tr:panelFormLayout>

<tr:inputText>
  <tr:validateLength minimum="2"/>
</tr:inputText> 

       <tr:commandButton text="Go" />
</tr:panelFormLayout>
       </tr:form>
    </tr:document>
  </f:view>
</jsp:root>


Next step is checking your WAR w/ updated JARs.


> Length validator broken if "maximum" attributes is missing
> ----------------------------------------------------------
>
>                 Key: TRINIDAD-1195
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-1195
>             Project: MyFaces Trinidad
>          Issue Type: Bug
>    Affects Versions: 1.2.9-core
>            Reporter: Stephen Friedrich
>         Attachments: 0-or-more-not-fewer.png, 2-up-to-a-maximum-of-0.png
>
>
> <tr:validateLength minimum="2">
> Client side validation _always_  results in "Enter 2 or more characters, up to a maximum of 0."
> No valid data can be entered at all.
> Server side validation works in principal, but spits out an incorrect message when the validation (correctly) fails: "Enter 0 or more characters, not fewer."
> See https://issues.apache.org/jira/browse/TRINIDAD-1130 for test.war that you can simply drop into Tomcat 6.
> Much of my code omits the "maximum" attribute, because I have a maximum length set on my input components (so that joe user just cannot enter more characters anyway) and have wrapped the form in a seam validation (s:validateAll) that validates on the server side against constraints set with hibernate validation annotations on the entity objects (so that a hacker can do no harm).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (TRINIDAD-1195) Length validator broken if "maximum" attributes is missing

Posted by "Matthias Weßendorf (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/TRINIDAD-1195?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12626475#action_12626475 ] 

Matthias Weßendorf commented on TRINIDAD-1195:
----------------------------------------------

Bug: Field is always required, even when set to false via PPR.  =>
I noticed it has changed (the required is removed, when clicking the checkbox)

Bug: inputText looses its value when switching from disabled to not-disabled.
I saw as well.

Can you please keep these bugs separate ? It is pretty confusing to discuss 
several (not related) things in one bug ?

Regarding: 
Bug: inputText looses its value when switching from disabled to not-disabled.
Can you open a ticket ?

> Length validator broken if "maximum" attributes is missing
> ----------------------------------------------------------
>
>                 Key: TRINIDAD-1195
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-1195
>             Project: MyFaces Trinidad
>          Issue Type: Bug
>    Affects Versions: 1.2.9-core
>            Reporter: Stephen Friedrich
>            Assignee: Matthias Weßendorf
>             Fix For: 1.2.10-core, 1.0.10-core
>
>         Attachments: 0-or-more-not-fewer.png, 2-up-to-a-maximum-of-0.png, confused.PNG, server-side1.PNG, server-side2.PNG
>
>
> <tr:validateLength minimum="2">
> Client side validation _always_  results in "Enter 2 or more characters, up to a maximum of 0."
> No valid data can be entered at all.
> Server side validation works in principal, but spits out an incorrect message when the validation (correctly) fails: "Enter 0 or more characters, not fewer."
> See https://issues.apache.org/jira/browse/TRINIDAD-1130 for test.war that you can simply drop into Tomcat 6.
> Much of my code omits the "maximum" attribute, because I have a maximum length set on my input components (so that joe user just cannot enter more characters anyway) and have wrapped the form in a seam validation (s:validateAll) that validates on the server side against constraints set with hibernate validation annotations on the entity objects (so that a hacker can do no harm).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (TRINIDAD-1195) Length validator broken if "maximum" attributes is missing

Posted by "Stephen Friedrich (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/TRINIDAD-1195?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12626480#action_12626480 ] 

Stephen Friedrich commented on TRINIDAD-1195:
---------------------------------------------

> entered "1" and got an error (as expected) 

Yes, but please do have a close look at the screenshot "server-side1.PNG" you uploaded yourself.
It shows exactly the problem that I mentioned right from the start:
"Server side validation works in principal, but spits out an incorrect message when the validation (correctly) fails: "Enter 0 or more characters, not fewer.""

You might just as well call that message funny or stupid, but it will definitely confuse users when they are told not to enter fewer than zero characters.

> I noticed it has changed (the required is removed, when clicking the checkbox) 
Yes, the icon is removed, but _try to submit_ with an empty value and validation fails and tells you you must enter a value.

> Length validator broken if "maximum" attributes is missing
> ----------------------------------------------------------
>
>                 Key: TRINIDAD-1195
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-1195
>             Project: MyFaces Trinidad
>          Issue Type: Bug
>    Affects Versions: 1.2.9-core
>            Reporter: Stephen Friedrich
>            Assignee: Matthias Weßendorf
>             Fix For: 1.2.10-core, 1.0.10-core
>
>         Attachments: 0-or-more-not-fewer.png, 2-up-to-a-maximum-of-0.png, confused.PNG, server-side1.PNG, server-side2.PNG
>
>
> <tr:validateLength minimum="2">
> Client side validation _always_  results in "Enter 2 or more characters, up to a maximum of 0."
> No valid data can be entered at all.
> Server side validation works in principal, but spits out an incorrect message when the validation (correctly) fails: "Enter 0 or more characters, not fewer."
> See https://issues.apache.org/jira/browse/TRINIDAD-1130 for test.war that you can simply drop into Tomcat 6.
> Much of my code omits the "maximum" attribute, because I have a maximum length set on my input components (so that joe user just cannot enter more characters anyway) and have wrapped the form in a seam validation (s:validateAll) that validates on the server side against constraints set with hibernate validation annotations on the entity objects (so that a hacker can do no harm).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (TRINIDAD-1195) Length validator broken if "maximum" attributes is missing

Posted by "Stephen Friedrich (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/TRINIDAD-1195?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12626484#action_12626484 ] 

Stephen Friedrich commented on TRINIDAD-1195:
---------------------------------------------

Thanks Matthias, I created TRINIDAD-1198 and TRINIDAD-1199 for the PPR problems, so we can continue any necessary discussion there.

> Length validator broken if "maximum" attributes is missing
> ----------------------------------------------------------
>
>                 Key: TRINIDAD-1195
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-1195
>             Project: MyFaces Trinidad
>          Issue Type: Bug
>    Affects Versions: 1.2.9-core
>            Reporter: Stephen Friedrich
>            Assignee: Matthias Weßendorf
>             Fix For: 1.2.10-core, 1.0.10-core
>
>         Attachments: 0-or-more-not-fewer.png, 2-up-to-a-maximum-of-0.png, confused.PNG, server-side1.PNG, server-side2.PNG
>
>
> <tr:validateLength minimum="2">
> Client side validation _always_  results in "Enter 2 or more characters, up to a maximum of 0."
> No valid data can be entered at all.
> Server side validation works in principal, but spits out an incorrect message when the validation (correctly) fails: "Enter 0 or more characters, not fewer."
> See https://issues.apache.org/jira/browse/TRINIDAD-1130 for test.war that you can simply drop into Tomcat 6.
> Much of my code omits the "maximum" attribute, because I have a maximum length set on my input components (so that joe user just cannot enter more characters anyway) and have wrapped the form in a seam validation (s:validateAll) that validates on the server side against constraints set with hibernate validation annotations on the entity objects (so that a hacker can do no harm).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (TRINIDAD-1195) Length validator broken if "maximum" attributes is missing

Posted by "Stephen Friedrich (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/TRINIDAD-1195?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12626100#action_12626100 ] 

Stephen Friedrich commented on TRINIDAD-1195:
---------------------------------------------

No, this is not a seam issue.
See the war file in TRINIDAD-1130 for a complete test application (including deployable war, jsp, sources and even an ant script).
That test.war is the minimal application using trinidad and mojarra that I could think of.


> Length validator broken if "maximum" attributes is missing
> ----------------------------------------------------------
>
>                 Key: TRINIDAD-1195
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-1195
>             Project: MyFaces Trinidad
>          Issue Type: Bug
>    Affects Versions: 1.2.9-core
>            Reporter: Stephen Friedrich
>         Attachments: 0-or-more-not-fewer.png, 2-up-to-a-maximum-of-0.png
>
>
> <tr:validateLength minimum="2">
> Client side validation _always_  results in "Enter 2 or more characters, up to a maximum of 0."
> No valid data can be entered at all.
> Server side validation works in principal, but spits out an incorrect message when the validation (correctly) fails: "Enter 0 or more characters, not fewer."
> See https://issues.apache.org/jira/browse/TRINIDAD-1130 for test.war that you can simply drop into Tomcat 6.
> Much of my code omits the "maximum" attribute, because I have a maximum length set on my input components (so that joe user just cannot enter more characters anyway) and have wrapped the form in a seam validation (s:validateAll) that validates on the server side against constraints set with hibernate validation annotations on the entity objects (so that a hacker can do no harm).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (TRINIDAD-1195) Length validator broken if "maximum" attributes is missing

Posted by "Stephen Friedrich (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/TRINIDAD-1195?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12626468#action_12626468 ] 

Stephen Friedrich commented on TRINIDAD-1195:
---------------------------------------------

Thanks Matthias for caring about this.
I'm sorry to say that the strange error message (don't enter fewer than 0 characters) when using server side validation has _not_ been fixed in the current svn version.

Also, I checked the PPR bugs in TRINIDAD-1130 (marked as fixed in 1.2.9): Those bugs are also still happening in latest svn.

> Length validator broken if "maximum" attributes is missing
> ----------------------------------------------------------
>
>                 Key: TRINIDAD-1195
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-1195
>             Project: MyFaces Trinidad
>          Issue Type: Bug
>    Affects Versions: 1.2.9-core
>            Reporter: Stephen Friedrich
>            Assignee: Matthias Weßendorf
>             Fix For: 1.2.10-core, 1.0.10-core
>
>         Attachments: 0-or-more-not-fewer.png, 2-up-to-a-maximum-of-0.png, confused.PNG
>
>
> <tr:validateLength minimum="2">
> Client side validation _always_  results in "Enter 2 or more characters, up to a maximum of 0."
> No valid data can be entered at all.
> Server side validation works in principal, but spits out an incorrect message when the validation (correctly) fails: "Enter 0 or more characters, not fewer."
> See https://issues.apache.org/jira/browse/TRINIDAD-1130 for test.war that you can simply drop into Tomcat 6.
> Much of my code omits the "maximum" attribute, because I have a maximum length set on my input components (so that joe user just cannot enter more characters anyway) and have wrapped the form in a seam validation (s:validateAll) that validates on the server side against constraints set with hibernate validation annotations on the entity objects (so that a hacker can do no harm).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (TRINIDAD-1195) Length validator broken if "maximum" attributes is missing

Posted by "Matthias Weßendorf (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/TRINIDAD-1195?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12625993#action_12625993 ] 

Matthias Weßendorf commented on TRINIDAD-1195:
----------------------------------------------

Tested this (in JSPX):
<tr:inputText>
  <tr:validateLength minimum="2"/> 
</tr:inputText>

(default setting is that client side is turned on)

with 1.2.x trunk (1.2.10-SNAPSHOT)
entered "ABCDEF" ==> FINE (as expected)
entered "A" => ERROR (as expected)


I know you are using seam. Is it possible that some JAR (like Trinidad) overrides the id's for the validators?
Trinidad's tag creates the Validator (and the converter) based on the ID.

> Length validator broken if "maximum" attributes is missing
> ----------------------------------------------------------
>
>                 Key: TRINIDAD-1195
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-1195
>             Project: MyFaces Trinidad
>          Issue Type: Bug
>    Affects Versions: 1.2.9-core
>            Reporter: Stephen Friedrich
>         Attachments: 0-or-more-not-fewer.png, 2-up-to-a-maximum-of-0.png
>
>
> <tr:validateLength minimum="2">
> Client side validation _always_  results in "Enter 2 or more characters, up to a maximum of 0."
> No valid data can be entered at all.
> Server side validation works in principal, but spits out an incorrect message when the validation (correctly) fails: "Enter 0 or more characters, not fewer."
> See https://issues.apache.org/jira/browse/TRINIDAD-1130 for test.war that you can simply drop into Tomcat 6.
> Much of my code omits the "maximum" attribute, because I have a maximum length set on my input components (so that joe user just cannot enter more characters anyway) and have wrapped the form in a seam validation (s:validateAll) that validates on the server side against constraints set with hibernate validation annotations on the entity objects (so that a hacker can do no harm).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (TRINIDAD-1195) Length validator broken if "maximum" attributes is missing

Posted by "Matthias Weßendorf (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/TRINIDAD-1195?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12626483#action_12626483 ] 

Matthias Weßendorf commented on TRINIDAD-1195:
----------------------------------------------

Stephen, I am sorry. I found the issue.
We pass the MAX into the message.... I am sorry, I haven't watched the pic close enough.

regarding the other issues, can you open separate bugs on that?

> Length validator broken if "maximum" attributes is missing
> ----------------------------------------------------------
>
>                 Key: TRINIDAD-1195
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-1195
>             Project: MyFaces Trinidad
>          Issue Type: Bug
>    Affects Versions: 1.2.9-core
>            Reporter: Stephen Friedrich
>            Assignee: Matthias Weßendorf
>             Fix For: 1.2.10-core, 1.0.10-core
>
>         Attachments: 0-or-more-not-fewer.png, 2-up-to-a-maximum-of-0.png, confused.PNG, server-side1.PNG, server-side2.PNG
>
>
> <tr:validateLength minimum="2">
> Client side validation _always_  results in "Enter 2 or more characters, up to a maximum of 0."
> No valid data can be entered at all.
> Server side validation works in principal, but spits out an incorrect message when the validation (correctly) fails: "Enter 0 or more characters, not fewer."
> See https://issues.apache.org/jira/browse/TRINIDAD-1130 for test.war that you can simply drop into Tomcat 6.
> Much of my code omits the "maximum" attribute, because I have a maximum length set on my input components (so that joe user just cannot enter more characters anyway) and have wrapped the form in a seam validation (s:validateAll) that validates on the server side against constraints set with hibernate validation annotations on the entity objects (so that a hacker can do no harm).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.