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
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-
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
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
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
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
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"
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
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
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
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
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
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
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' &
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
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
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
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
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
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
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
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
.
--
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
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,
>
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]
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"
--- 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
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
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
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
--- 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
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
--- 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
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
--- 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
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
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
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
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
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:
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
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
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
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
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
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
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
--- 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.
___
; 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 <
, 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
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
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
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
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.
Hello.
Is-it possible to internationalize validation messages when using
annotations ?
PPDL.
55 matches
Mail list logo