struts-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lukasz Lenart (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (WW-4272) Add a fieldKey attribute to validators
Date Tue, 29 Jul 2014 07:26:38 GMT

     [ https://issues.apache.org/jira/browse/WW-4272?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Lukasz Lenart updated WW-4272:
------------------------------

    Description: 
Taking into account that in the struts2 taglib a field usually has a name and a key (for its
label), why there isn't also a fieldKey in validators?

For example, you have the following field in JSP:
{code:xml}
<s:textfield name="name" key="personalData.name"/>
{code}
and then in the Action (ModelDriven) :
{code:java}
@RequiredStringValidator(type = ValidatorType.SIMPLE, fieldName = "model.name", key = "errors.required")
{code}
so you have to add to the .properties file personalData.name and also name. I would prefer
something like:
{code:java}
@RequiredStringValidator(type = ValidatorType.SIMPLE, fieldName = "model.name", fieldKey =
"personalData.name", key = "errors.required")
{code}
Am I missing something? If not, why does not exist the fieldKey in validators?

Thank you in advance

  was:
Taking into account that in the struts2 taglib a field usually has a name and a key (for its
label), why there isn't also a fieldKey in validators?

For example, you have the following field in JSP:

<s:textfield name="name" key="personalData.name"/>

and then in the Action (ModelDriven) :

@RequiredStringValidator(type = ValidatorType.SIMPLE, fieldName = "model.name", key = "errors.required")

so you have to add to the .properties file personalData.name and also name. I would prefer
something like:

@RequiredStringValidator(type = ValidatorType.SIMPLE, fieldName = "model.name", fieldKey =
"personalData.name", key = "errors.required")

Am I missing something? If not, why does not exist the fieldKey in validators?

Thank you in advance


> Add a fieldKey attribute to validators
> --------------------------------------
>
>                 Key: WW-4272
>                 URL: https://issues.apache.org/jira/browse/WW-4272
>             Project: Struts 2
>          Issue Type: Improvement
>          Components: Annotations, XML Validators
>            Reporter: cococo42
>            Priority: Minor
>              Labels: ValidationMessages
>             Fix For: 2.3.18
>
>
> Taking into account that in the struts2 taglib a field usually has a name and a key (for
its label), why there isn't also a fieldKey in validators?
> For example, you have the following field in JSP:
> {code:xml}
> <s:textfield name="name" key="personalData.name"/>
> {code}
> and then in the Action (ModelDriven) :
> {code:java}
> @RequiredStringValidator(type = ValidatorType.SIMPLE, fieldName = "model.name", key =
"errors.required")
> {code}
> so you have to add to the .properties file personalData.name and also name. I would prefer
something like:
> {code:java}
> @RequiredStringValidator(type = ValidatorType.SIMPLE, fieldName = "model.name", fieldKey
= "personalData.name", key = "errors.required")
> {code}
> Am I missing something? If not, why does not exist the fieldKey in validators?
> Thank you in advance



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message