Re: Annotation validation setter level

2018-01-08 Thread José Antonio Delgado Trujillo
Thanks a lot for the link and the explanation. Un saludo, José A. > On 6 Jan 2018, at 10:37, Hedju Hor wrote: > > Hi, use @VisitorFieldValidator > 1. in Action-Class annotad gettter Method of the model with > @VisitorFieldValidator > 2. @EmailValidator on getter in Model Person.getEmail > > s

Re: Annotation validation setter level

2018-01-06 Thread Hedju Hor
Hi, use @VisitorFieldValidator 1. in Action-Class annotad gettter Method of the model with @VisitorFieldValidator 2. @EmailValidator on getter in Model Person.getEmail see https://depressedprogrammer.wordpress.com/2007/05/10/struts-2-validation-using-annotations/ Regards Hedju Hor On 2018-01-

Annotation validation setter level

2018-01-05 Thread José Antonio Delgado Trujillo
Annotations validations an alternative way of XML validation or the simplest way to implement the validate method. Yo have two options: At method level At setter level In the second if you don’t have the setter in the Action class because it is a property of an object, where do i put the annot

Re: Annotation Validation

2010-04-29 Thread Alex Rodriguez Lopez
d in place of the {0}. Em 28-04-2010 21:30, mrsv escreveu: Did you try something like this? @RequiredStringValidator( fieldName = "label.name", key ="error.required ", message = "Name required.")} Alex Rodriguez Lopez wrote: Hi struts us

Re: Annotation Validation

2010-04-28 Thread mrsv
Did you try something like this? @RequiredStringValidator( fieldName = "label.name", key ="error.required ", message = "Name required.")} Alex Rodriguez Lopez wrote: > > Hi struts users! > > I'm on my way to change from

Annotation Validation

2010-04-28 Thread Alex Rodriguez Lopez
Hi struts users! I'm on my way to change from XML based validation to annotation validation. I've manage to get it working, but (probably due to my little knowledge of Java annotations) there are some things I can't get to work, so I apologise if this question is not entirelly

Re: [S2] Annotation Validation - string substitution in message

2009-05-14 Thread Dave Newton
Norris Shelton wrote: I need some clarification. I should have the following in my globalMessages? required.string.message=${get(fieldName)} is required How would I specify field name? Hmm, in retrospect, I don't know if this technique works with annotations. With XML validation "fieldName"

Re: [S2] Annotation Validation - string substitution in message

2009-05-14 Thread Norris Shelton
norrisshelton From: Dave Newton To: Struts Users Mailing List Sent: Thursday, May 14, 2009 3:13:53 PM Subject: Re: [S2] Annotation Validation - string substitution in message Norris Shelton wrote: > I am using the following annotation for validat

Re: [S2] Annotation Validation - string substitution in message

2009-05-14 Thread Dave Newton
Norris Shelton wrote: I am using the following annotation for validation: @RequiredStringValidator(key = "required.string.message") I have the following in my globalMessages: required.string.message=${string.name} is required Is there a way to substitute the name of the field or a string that I

[S2] Annotation Validation - string substitution in message

2009-05-14 Thread Norris Shelton
I am using the following annotation for validation: @RequiredStringValidator(key = "required.string.message") I have the following in my globalMessages: required.string.message=${string.name} is required Is there a way to substitute the name of the field or a string that I specify take the place

Re: How to invoke annotation validation manually

2009-05-11 Thread joea88
avm = new AnnotationActionValidatorManager(); avm.validate(this, null, "getName"); After that, you just need to call 'hasErrors()' to see the result. I'm not sure this is the best way to invoke the annotation validation though. Let me know if you found any bett

Re: How to invoke annotation validation manually

2009-05-11 Thread Dave Newton
joea88 wrote: I've an action class like below. I put the skipvalidation annotation because I don't want strut to validate all annotated fields. My problem is that I still want to do the validation for 'name' field. So.. is there a way to manually invoke only certai

How to invoke annotation validation manually

2009-05-10 Thread joea88
Hi I've an action class like below. I put the skipvalidation annotation because I don't want strut to validate all annotated fields. My problem is that I still want to do the validation for 'name' field. So.. is there a way to manually invoke only certain fields' annot

Check Field Value in list using Annotation/Validation?

2009-03-13 Thread Griffith, Michael *
Hello all, Is it possible to check a field value against a list using the @ConditionalVisitorFieldValidator annotation? I'm thinking of something like this: @Column(name="VENDOR_TYPE", nullable=false) @ConditionalVisitorFieldValidator (expression="vendorType == 'COTS'&& vendorType == 'GOTS' &

I18n problem with annotation validation

2008-09-24 Thread Jeroen Simons
Hi, I have a i18n problem when validating a field in my action. (Struts 2.0.11.2) My validation: @RequiredStringValidator( fieldName = "user.username", key = "error.required", message = "") My resource bundle reads this: error.required=${getText(fieldName)} is required. To have a lo

Re: Struts 2 Annotation Validation Problem

2008-09-21 Thread mctdeveloper
Just see the below link for usage of Annotations in validation, Hope might be useful http://intricatetips.blogspot.com -- View this message in context: http://www.nabble.com/Struts-2-Annotation-Validation-Problem-tp16990235p19592822.html Sent from the Struts - User mailing list archive at

annotation validation problem

2008-06-16 Thread xaero
i have used annotation validation in my code. There are two methods login and logout in the same class. I have done mapping of both the methods in struts.xml. Now when i run my application the login method runs fine but when i try to run the logout method i get error that mapping for result

Re: Struts 2 Annotation Validation Problem

2008-05-06 Thread Wes Wannemacher
I could be wrong in my assumption, but I became suspicious when the action class wasn't in the stacktrace... On Tue, 2008-05-06 at 20:48 -0400, Jim Kiley wrote: > It's weird and confusing that inherited methods don't make it into the proxy > class. Took me an age to figure it out, in no small p

Re: Struts 2 Annotation Validation Problem

2008-05-06 Thread Jim Kiley
It's weird and confusing that inherited methods don't make it into the proxy class. Took me an age to figure it out, in no small part because I couldn't find an easy way to inspect the proxy class's methods. My workaround was to eliminate the @Transactional annotation entirely, and I'm hoping tha

Re: Struts 2 Annotation Validation Problem

2008-05-06 Thread Wes Wannemacher
Sorry I didn't catch this earlier, but I had the exact same problem. It would seem that when you use Spring's @Transactional annnotation, the class gets proxied... Which I would think is okay, except for the fact that inherited methods (such as ActionSupport.input()) do not make it into the proxied

Re: Struts 2 Annotation Validation Problem

2008-05-06 Thread Jim Kiley
I solved this problem and I figure that nabble might want to record the end reason for the bug. Another method entirely, elsewhere on ProductDetailAction, had a @Transactional annotation. It didn't need one -- I was using injected transaction management and the OpenEntityManagerInViewFilter. Why

Struts 2 Annotation Validation Problem

2008-04-30 Thread Jim Kiley
Hi folks, I've run into a problem with Struts 2 validation annotations. In short -- I have a VisitorFieldValidator on an action POJO named ProductDetailAction. I have RequiredFieldValidator and RequiredStringValidator on one field within the "visited" object. Now -- ProductDetailAction did not

Annotation Validation: compare two fields

2008-04-22 Thread mteccles
. -- View this message in context: http://www.nabble.com/Annotation-Validation%3A-compare-two-fields-tp16823806p16823806.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL

Re: Error messages is repeated Using Struts 2 Annotation validation

2008-01-30 Thread Randy Burgess
son nickel <[EMAIL PROTECTED]> > Reply-To: Struts Users Mailing List > Date: Tue, 29 Jan 2008 23:28:42 -0800 (PST) > To: > Subject: Re: Error messages is repeated Using Struts 2 Annotation validation > > > Thanks for your quick response, > > In my Login.jsp, >

Re: Error messages is repeated Using Struts 2 Annotation validation

2008-01-29 Thread Johnson nickel
TED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- View this message in context: http://www.nabble.com/Error-messages-is-repeated-Using-Struts-2-Annotation-validation-tp15157319p15176802.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Error messages is repeated Using Struts 2 Annotation validation

2008-01-29 Thread David Tercero
configuration problems. I have use the > Annotation validation to validate the > Username and password fields in my Login page. > > Code: > > > @RequiredFieldValidator(type=ValidatorType.SIMPLE,fieldName="username",message="UserName > is required"

Re: Error messages is repeated Using Struts 2 Annotation validation

2008-01-29 Thread Dave Newton
--- Johnson nickel <[EMAIL PROTECTED]> wrote: > @RequiredFieldValidator(type=ValidatorType.SIMPLE,fieldName="username",message="UserName > is required") For a string field you'll probably want to use the @RequiredStringValidator: a text field will return an empty string, whereas @RequiredFieldVali

Error messages is repeated Using Struts 2 Annotation validation

2008-01-29 Thread Johnson nickel
Hi Friends, I am using Struts 2 application for my project. Before I was used Struts 1 when compare to this Struts 2 is reduced lot of configuration problems. I have use the Annotation validation to validate the Username and password fields in my Login page. Code

Re: How Many Methods Must an Action Walk Down (was Re: Annotation Validation, per method?)

2007-11-07 Thread Don Brown
On Nov 8, 2007 12:29 PM, Dave Newton <[EMAIL PROTECTED]> wrote: > --- Gary Affonso <[EMAIL PROTECTED]> wrote: > > > Look at the "Dynamic Method Invocation" section, > > > 1/2-2/3 of the way down. > > Well, that explains it. The wildcard feature seems > > to come from s1 (which I never used) and

Re: How Many Methods Must an Action Walk Down (was Re: Annotation Validation, per method?)

2007-11-07 Thread Gary Affonso
Dave Newton wrote: --- Gary Affonso <[EMAIL PROTECTED]> wrote: > Look at the "Dynamic Method Invocation" section, > 1/2-2/3 of the way down. Well, that explains it. The wildcard feature seems to come from s1 (which I never used) and the "dynamic method invocation" feature wasn't very well d

Re: How Many Methods Must an Action Walk Down (was Re: Annotation Validation, per method?)

2007-11-07 Thread Dave Newton
--- Gary Affonso <[EMAIL PROTECTED]> wrote: > > Look at the "Dynamic Method Invocation" section, > > 1/2-2/3 of the way down. > Well, that explains it. The wildcard feature seems > to come from s1 (which I never used) and the > "dynamic method invocation" feature wasn't > very well documented

Re: How Many Methods Must an Action Walk Down (was Re: Annotation Validation, per method?)

2007-11-07 Thread Gary Affonso
Dave Newton wrote: Curiously, action!input is not a part of the framework I'm familiarwith. Can you point me to some docs that describe it? > > http://struts.apache.org/2.x/docs/action-configuration.html > > Look at the "Dynamic Method Invocation" section, > 1/2-2/3 of the way down. Well, that

Re: How Many Methods Must an Action Walk Down (was Re: Annotation Validation, per method?)

2007-11-07 Thread Dave Newton
--- Jeromy Evans <[EMAIL PROTECTED]> wrote: > Dave, does that mean you don't favour one approach > over the other? ie. happy with multiple methods per action? I have no clear preference right now. I tend not to have a lot of methods in my actions anyway, but I'll group stuff together when it seems

Re: How Many Methods Must an Action Walk Down (was Re: Annotation Validation, per method?)

2007-11-07 Thread Jeromy Evans
Dave Newton wrote: Again, not one *method*. That'd be crazy! That's what's being discussed, I'm pretty sure, but with an eye towards a different "prepare" cycle: the whole Preparable lifecycle makes more sense if there are multiple (request-handling) methods in an Action class. If there's

Re: How Many Methods Must an Action Walk Down (was Re: Annotation Validation, per method?)

2007-11-07 Thread Dave Newton
--- Gary Affonso <[EMAIL PROTECTED]> wrote: > Ted Husted wrote: >> Meanwhile, in Struts 1 there is a "DispatchAction" >> that does much the same thing. From other >> discussions, I gather that "multiple actions per >> controller" is considered a Good Thing on platforms >> like Ruby on Rails. It's

Re: How Many Methods Must an Action Walk Down (was Re: Annotation Validation, per method?)

2007-11-07 Thread Gary Affonso
Ted Husted wrote: On Nov 6, 2007 8:10 PM, Gary Affonso <[EMAIL PROTECTED]> wrote: For some reason folks new to s2 seem to get it backwards and want to stuff a bunch of Action methods into a single Action class. It's probably because the standard S2/WW validation workflow implies that an Action

How Many Methods Must an Action Walk Down (was Re: Annotation Validation, per method?)

2007-11-07 Thread Ted Husted
On Nov 6, 2007 8:10 PM, Gary Affonso <[EMAIL PROTECTED]> wrote: > For some reason folks new to s2 seem to get it backwards and want to > stuff a bunch of Action methods into a single Action class. It's probably because the standard S2/WW validation workflow implies that an Action class will have m

Re: Annotation Validation, per method?

2007-11-06 Thread Gary Affonso
Ted Husted wrote: Of course, if you use one-action-method per Action-class, then all the annotations work just fine. +1 on one-action-method per Action class. My personal opinion (after nearly 5 years of heavy WebWork/s2 use) is that this is the best-practice and that multiple action methods

Re: Annotation Validation, per method?

2007-11-06 Thread Ted Husted
d than the xml version? > > > > - Original message - > From: "Fátima Silveira" <[EMAIL PROTECTED]> > To: "Struts Users Mailing List" > Date: Mon, 5 Nov 2007 17:58:32 +0100 > Subject: Re: Annotation Validation, per method? > > i dont know to use anotat

Re: Annotation Validation, per method?

2007-11-06 Thread Martin Gilday
Thanks. Is this not a severe limitation of the annotation version if it is more limited than the xml version? - Original message - From: "Fátima Silveira" <[EMAIL PROTECTED]> To: "Struts Users Mailing List" Date: Mon, 5 Nov 2007 17:58:32 +0100 Subject: Re:

Re: Annotation Validation, per method?

2007-11-05 Thread Fátima Silveira
i dont know to use anotation but with xml is ClassName-actionAlias_method- validation.xml On 11/5/07, Martin Gilday <[EMAIL PROTECTED]> wrote: > > Can you have annotation validation per method? I have put @Validations > on both my display and update methods (display shows the reco

Annotation Validation, per method?

2007-11-05 Thread Martin Gilday
Can you have annotation validation per method? I have put @Validations on both my display and update methods (display shows the record from input), but all of the validation seems to be run at once. Can you achieve this with xml or annotation validation, or am I back to validateInput methods

Re: S2 : XML vs annotation validation - thoughts?

2007-08-07 Thread Kevin Lawrence
soon my few actions were packed with them, to the point that I had more annotations that actual code in my actions :), so I went the xml way. musachy On 8/7/07, Jeromy Evans <[EMAIL PROTECTED]> wrote: Hi Joseph, I haven't used annotation validation since S2.0.6 so these issues m

Re: S2 : XML vs annotation validation - thoughts?

2007-08-07 Thread Ian Roughley
The validation and the related messages are on the domain objects and not the action, so they are separate. Then the action defines which domain object is validated via the visitor validation - there is also a prefix (not sure of the exact attribute off hand), which would ensure that coapp or

Re: S2 : XML vs annotation validation - thoughts?

2007-08-07 Thread j alex
Hi Ian, >From the documentation, VisitorFieldValidator seems interesting. Can you please provide some inputs on if/how we can use this for the following scenario : the domain object Name has properties firstname, lastname, initial etc. now, Name could be associated with a primaryapplicant or a

Re: S2 : XML vs annotation validation - thoughts?

2007-08-07 Thread Ian Roughley
And you can place them on the domain objects and use a visitor validator ;) Dave Newton wrote: --- j alex <[EMAIL PROTECTED]> wrote: My understanding is that the validators are tied to fields and not methods - right? They *can* be tied to the fields (in other words, every action metho

Re: S2 : XML vs annotation validation - thoughts?

2007-08-07 Thread Kevin Lawrence
scenario'. I guess I could have switched to xml validation but I have an instinctive aversion to separating the validation requirements from the code. I chose to live with the duplication. It's a little frustrating because the annotation validation is so elegant and extensible - but no

Re: S2 : XML vs annotation validation - thoughts?

2007-08-07 Thread Dave Newton
--- j alex <[EMAIL PROTECTED]> wrote: > My understanding is that the validators are tied to > fields and not methods - right? They *can* be tied to the fields (in other words, every action method) but you can specify validations based on the action name as well. d. ___

Re: S2 : XML vs annotation validation - thoughts?

2007-08-07 Thread j alex
; On my current project I started using annotations, but very soon my > > few actions were packed with them, to the point that I had more > > annotations that actual code in my actions :), so I went the xml way. > > > > musachy > > > > On 8/7/07, Jeromy Evans <

Re: S2 : XML vs annotation validation - thoughts?

2007-08-07 Thread Kevin Lawrence
, but very soon my few actions were packed with them, to the point that I had more annotations that actual code in my actions :), so I went the xml way. musachy On 8/7/07, Jeromy Evans <[EMAIL PROTECTED]> wrote: Hi Joseph, I haven't used annotation validation since S2.0.6 so these issu

Re: S2 : XML vs annotation validation - thoughts?

2007-08-07 Thread Musachy Barroso
I haven't used annotation validation since S2.0.6 so these issues may be > a little dated. > > These are my experiences: > 1. I tend to use wildcards in actions. In this situation, annotations > applied to properties in an action are not appropriate as not all > validati

Re: S2 : XML vs annotation validation - thoughts?

2007-08-07 Thread Jeromy Evans
Hi Joseph, I haven't used annotation validation since S2.0.6 so these issues may be a little dated. These are my experiences: 1. I tend to use wildcards in actions. In this situation, annotations applied to properties in an action are not appropriate as not all validations apply for

S2 : XML vs annotation validation - thoughts?

2007-08-07 Thread j alex
Hi, I am about to migrate a S1 app to S2 and need to decide which route to take regarding validations - XML or annotations? . Our app has a lot of custom validators involving rules dependent on multiple fields. Is there a specific benefit to using annotations vs XML ? Thanks, Joseph

Re: [S2] Annotation validation and I18N

2007-06-01 Thread Petit Pas De Lune
I'm stupid the key attribute. Thanks On 6/1/07, Petit Pas De Lune <[EMAIL PROTECTED]> wrote: Hello. Is-it possible to internationalize validation messages when using annotations ? PPDL.

[S2] Annotation validation and I18N

2007-06-01 Thread Petit Pas De Lune
Hello. Is-it possible to internationalize validation messages when using annotations ? PPDL.