You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "chad michael davis (JIRA)" <ji...@apache.org> on 2007/10/17 17:48:38 UTC

[jira] Created: (WW-2263) validation annotation message attribute required even if using key attribute

validation annotation message attribute required even if using key attribute
----------------------------------------------------------------------------

                 Key: WW-2263
                 URL: https://issues.apache.org/struts/browse/WW-2263
             Project: Struts 2
          Issue Type: Bug
          Components: Validation
    Affects Versions: 2.0.9
         Environment: Debian Linux
            Reporter: chad michael davis


This "bug" is about a quirky interface to validations using annotations.  In the XML, the message element can contain the text of the message in its body, or omit the body and use key attribute to name the key into the resource bundles for retrieving the message.  

Under annotations, the message attribute is always required.  Seems like you should be able to specify a key and drop the message attribute but you can't.  To specify a key you must use the  key attribute ( note, key and message are sibling level attributes of the annotation itself; this is different from the xml ) such as follows:

@EmailValidator(type = ValidatorType.FIELD, key="email.invalid", message="Email no good.")

In this annotation, I still have a message specified, as a back up I guess.  But if I try to remove it altogether, the equivalent of what i do in XML with the following:

  <field-validator type="requiredstring">
         <message key="username.required"/>
     </field-validator>

Then it blows up.  i guess this isn't a bug, but it seems kind of odd, forcing the user to specify a message text that won't be used ( a default message will be provided in the form of the key string itself if the properties file is missing, right? ), and its clearly inconsistent between the XML and the annotations

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


[jira] Updated: (WW-2263) validation annotation message attribute required even if using key attribute

Posted by "Don Brown (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/struts/browse/WW-2263?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Don Brown updated WW-2263:
--------------------------

    Component/s:     (was: Plugin - CodeBehind)
                 XML Validators

> validation annotation message attribute required even if using key attribute
> ----------------------------------------------------------------------------
>
>                 Key: WW-2263
>                 URL: https://issues.apache.org/struts/browse/WW-2263
>             Project: Struts 2
>          Issue Type: Bug
>          Components: XML Validators
>    Affects Versions: 2.0.9
>         Environment: Debian Linux
>            Reporter: chad michael davis
>             Fix For: 2.1.3
>
>
> This "bug" is about a quirky interface to validations using annotations.  In the XML, the message element can contain the text of the message in its body, or omit the body and use key attribute to name the key into the resource bundles for retrieving the message.  
> Under annotations, the message attribute is always required.  Seems like you should be able to specify a key and drop the message attribute but you can't.  To specify a key you must use the  key attribute ( note, key and message are sibling level attributes of the annotation itself; this is different from the xml ) such as follows:
> @EmailValidator(type = ValidatorType.FIELD, key="email.invalid", message="Email no good.")
> In this annotation, I still have a message specified, as a back up I guess.  But if I try to remove it altogether, the equivalent of what i do in XML with the following:
>   <field-validator type="requiredstring">
>          <message key="username.required"/>
>      </field-validator>
> Then it blows up.  i guess this isn't a bug, but it seems kind of odd, forcing the user to specify a message text that won't be used ( a default message will be provided in the form of the key string itself if the properties file is missing, right? ), and its clearly inconsistent between the XML and the annotations

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


[jira] Updated: (WW-2263) validation annotation message attribute required even if using key attribute

Posted by "Don Brown (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/struts/browse/WW-2263?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Don Brown updated WW-2263:
--------------------------

    Fix Version/s:     (was: 2.1.4)
                   2.1.3

> validation annotation message attribute required even if using key attribute
> ----------------------------------------------------------------------------
>
>                 Key: WW-2263
>                 URL: https://issues.apache.org/struts/browse/WW-2263
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - CodeBehind
>    Affects Versions: 2.0.9
>         Environment: Debian Linux
>            Reporter: chad michael davis
>             Fix For: 2.1.3
>
>
> This "bug" is about a quirky interface to validations using annotations.  In the XML, the message element can contain the text of the message in its body, or omit the body and use key attribute to name the key into the resource bundles for retrieving the message.  
> Under annotations, the message attribute is always required.  Seems like you should be able to specify a key and drop the message attribute but you can't.  To specify a key you must use the  key attribute ( note, key and message are sibling level attributes of the annotation itself; this is different from the xml ) such as follows:
> @EmailValidator(type = ValidatorType.FIELD, key="email.invalid", message="Email no good.")
> In this annotation, I still have a message specified, as a back up I guess.  But if I try to remove it altogether, the equivalent of what i do in XML with the following:
>   <field-validator type="requiredstring">
>          <message key="username.required"/>
>      </field-validator>
> Then it blows up.  i guess this isn't a bug, but it seems kind of odd, forcing the user to specify a message text that won't be used ( a default message will be provided in the form of the key string itself if the properties file is missing, right? ), and its clearly inconsistent between the XML and the annotations

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


[jira] Assigned: (WW-2263) validation annotation message attribute required even if using key attribute

Posted by "Rainer Hermanns (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/struts/browse/WW-2263?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rainer Hermanns reassigned WW-2263:
-----------------------------------

    Assignee: Rainer Hermanns

> validation annotation message attribute required even if using key attribute
> ----------------------------------------------------------------------------
>
>                 Key: WW-2263
>                 URL: https://issues.apache.org/struts/browse/WW-2263
>             Project: Struts 2
>          Issue Type: Bug
>          Components: XML Validators
>    Affects Versions: 2.0.9
>         Environment: Debian Linux
>            Reporter: chad michael davis
>            Assignee: Rainer Hermanns
>             Fix For: 2.1.3
>
>
> This "bug" is about a quirky interface to validations using annotations.  In the XML, the message element can contain the text of the message in its body, or omit the body and use key attribute to name the key into the resource bundles for retrieving the message.  
> Under annotations, the message attribute is always required.  Seems like you should be able to specify a key and drop the message attribute but you can't.  To specify a key you must use the  key attribute ( note, key and message are sibling level attributes of the annotation itself; this is different from the xml ) such as follows:
> @EmailValidator(type = ValidatorType.FIELD, key="email.invalid", message="Email no good.")
> In this annotation, I still have a message specified, as a back up I guess.  But if I try to remove it altogether, the equivalent of what i do in XML with the following:
>   <field-validator type="requiredstring">
>          <message key="username.required"/>
>      </field-validator>
> Then it blows up.  i guess this isn't a bug, but it seems kind of odd, forcing the user to specify a message text that won't be used ( a default message will be provided in the form of the key string itself if the properties file is missing, right? ), and its clearly inconsistent between the XML and the annotations

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


[jira] Resolved: (WW-2263) validation annotation message attribute required even if using key attribute

Posted by "Rainer Hermanns (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/struts/browse/WW-2263?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rainer Hermanns resolved WW-2263.
---------------------------------

    Resolution: Fixed

fixed in xwork trunk

> validation annotation message attribute required even if using key attribute
> ----------------------------------------------------------------------------
>
>                 Key: WW-2263
>                 URL: https://issues.apache.org/struts/browse/WW-2263
>             Project: Struts 2
>          Issue Type: Bug
>          Components: XML Validators
>    Affects Versions: 2.0.9
>         Environment: Debian Linux
>            Reporter: chad michael davis
>            Assignee: Rainer Hermanns
>             Fix For: 2.1.3
>
>
> This "bug" is about a quirky interface to validations using annotations.  In the XML, the message element can contain the text of the message in its body, or omit the body and use key attribute to name the key into the resource bundles for retrieving the message.  
> Under annotations, the message attribute is always required.  Seems like you should be able to specify a key and drop the message attribute but you can't.  To specify a key you must use the  key attribute ( note, key and message are sibling level attributes of the annotation itself; this is different from the xml ) such as follows:
> @EmailValidator(type = ValidatorType.FIELD, key="email.invalid", message="Email no good.")
> In this annotation, I still have a message specified, as a back up I guess.  But if I try to remove it altogether, the equivalent of what i do in XML with the following:
>   <field-validator type="requiredstring">
>          <message key="username.required"/>
>      </field-validator>
> Then it blows up.  i guess this isn't a bug, but it seems kind of odd, forcing the user to specify a message text that won't be used ( a default message will be provided in the form of the key string itself if the properties file is missing, right? ), and its clearly inconsistent between the XML and the annotations

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


[jira] Commented: (WW-2263) validation annotation message attribute required even if using key attribute

Posted by "Rainer Hermanns (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-2263?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=44231#action_44231 ] 

Rainer Hermanns commented on WW-2263:
-------------------------------------

agreed :) will do this for the XW 2.1.2 release

> validation annotation message attribute required even if using key attribute
> ----------------------------------------------------------------------------
>
>                 Key: WW-2263
>                 URL: https://issues.apache.org/struts/browse/WW-2263
>             Project: Struts 2
>          Issue Type: Bug
>          Components: XML Validators
>    Affects Versions: 2.0.9
>         Environment: Debian Linux
>            Reporter: chad michael davis
>            Assignee: Rainer Hermanns
>             Fix For: 2.1.3
>
>
> This "bug" is about a quirky interface to validations using annotations.  In the XML, the message element can contain the text of the message in its body, or omit the body and use key attribute to name the key into the resource bundles for retrieving the message.  
> Under annotations, the message attribute is always required.  Seems like you should be able to specify a key and drop the message attribute but you can't.  To specify a key you must use the  key attribute ( note, key and message are sibling level attributes of the annotation itself; this is different from the xml ) such as follows:
> @EmailValidator(type = ValidatorType.FIELD, key="email.invalid", message="Email no good.")
> In this annotation, I still have a message specified, as a back up I guess.  But if I try to remove it altogether, the equivalent of what i do in XML with the following:
>   <field-validator type="requiredstring">
>          <message key="username.required"/>
>      </field-validator>
> Then it blows up.  i guess this isn't a bug, but it seems kind of odd, forcing the user to specify a message text that won't be used ( a default message will be provided in the form of the key string itself if the properties file is missing, right? ), and its clearly inconsistent between the XML and the annotations

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


[jira] Commented: (WW-2263) validation annotation message attribute required even if using key attribute

Posted by "Bob Tiernay (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-2263?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=44217#action_44217 ] 

Bob Tiernay commented on WW-2263:
---------------------------------

I agree that this is quite confusing and lead to a lot of message="".

Recommend making this this optional.

> validation annotation message attribute required even if using key attribute
> ----------------------------------------------------------------------------
>
>                 Key: WW-2263
>                 URL: https://issues.apache.org/struts/browse/WW-2263
>             Project: Struts 2
>          Issue Type: Bug
>          Components: XML Validators
>    Affects Versions: 2.0.9
>         Environment: Debian Linux
>            Reporter: chad michael davis
>             Fix For: 2.1.3
>
>
> This "bug" is about a quirky interface to validations using annotations.  In the XML, the message element can contain the text of the message in its body, or omit the body and use key attribute to name the key into the resource bundles for retrieving the message.  
> Under annotations, the message attribute is always required.  Seems like you should be able to specify a key and drop the message attribute but you can't.  To specify a key you must use the  key attribute ( note, key and message are sibling level attributes of the annotation itself; this is different from the xml ) such as follows:
> @EmailValidator(type = ValidatorType.FIELD, key="email.invalid", message="Email no good.")
> In this annotation, I still have a message specified, as a back up I guess.  But if I try to remove it altogether, the equivalent of what i do in XML with the following:
>   <field-validator type="requiredstring">
>          <message key="username.required"/>
>      </field-validator>
> Then it blows up.  i guess this isn't a bug, but it seems kind of odd, forcing the user to specify a message text that won't be used ( a default message will be provided in the form of the key string itself if the properties file is missing, right? ), and its clearly inconsistent between the XML and the annotations

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


[jira] Commented: (WW-2263) validation annotation message attribute required even if using key attribute

Posted by "Dave Newton (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/WW-2263?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=44240#action_44240 ] 

Dave Newton commented on WW-2263:
---------------------------------

Oh, good; thanks! I kept forgetting to bring this up or fix it :(

> validation annotation message attribute required even if using key attribute
> ----------------------------------------------------------------------------
>
>                 Key: WW-2263
>                 URL: https://issues.apache.org/struts/browse/WW-2263
>             Project: Struts 2
>          Issue Type: Bug
>          Components: XML Validators
>    Affects Versions: 2.0.9
>         Environment: Debian Linux
>            Reporter: chad michael davis
>            Assignee: Rainer Hermanns
>             Fix For: 2.1.3
>
>
> This "bug" is about a quirky interface to validations using annotations.  In the XML, the message element can contain the text of the message in its body, or omit the body and use key attribute to name the key into the resource bundles for retrieving the message.  
> Under annotations, the message attribute is always required.  Seems like you should be able to specify a key and drop the message attribute but you can't.  To specify a key you must use the  key attribute ( note, key and message are sibling level attributes of the annotation itself; this is different from the xml ) such as follows:
> @EmailValidator(type = ValidatorType.FIELD, key="email.invalid", message="Email no good.")
> In this annotation, I still have a message specified, as a back up I guess.  But if I try to remove it altogether, the equivalent of what i do in XML with the following:
>   <field-validator type="requiredstring">
>          <message key="username.required"/>
>      </field-validator>
> Then it blows up.  i guess this isn't a bug, but it seems kind of odd, forcing the user to specify a message text that won't be used ( a default message will be provided in the form of the key string itself if the properties file is missing, right? ), and its clearly inconsistent between the XML and the annotations

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