You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Gundersen, Richard" <Ri...@london-scottish.com> on 2008/09/19 12:18:35 UTC
VisitorFieldValidator - different validation scenarios
Hi
I'm using the VisitorFieldValidator (annotations) to push validation
over to my model object in my Action.
However, I want the validation rules in my model object to work
differently depending on which Action method is being called.
What's the best way of doing this please?
Richard Gundersen
Java Developer
Email: richard.gundersen@london-scottish.com
Phone: 01618302398
Fax: 01618342536
London Scottish Bank plc
24 Mount Street
Manchester
M2 3LS
As a responsible corporate citizen, London Scottish Bank plc asks you to consider the environment before printing this email.
*** Disclaimer ***
This electronic communication is confidential and for the exclusive use of the addressee. It may contain private and confidential information. The information, attachments and opinions contained in this E-mail are those of its author only and do not necessarily represent those of London Scottish Bank PLC or any other members of the London Scottish Group.
If you are not the intended addressee, you are prohibited from any disclosure, distribution or further copying or use of this communication or the information in it or taking any action in reliance on it. If you have received this communication in error please notify the Information Security Manager at ISM@London-Scottish.com as soon as possible and delete the message from all places in your computer where it is stored.
We utilise virus scanning software but we cannot guarantee the security of electronic communications and you are advised to check any attachments for viruses. We do not accept liability for any loss resulting from any corruption or alteration of data or importation of any virus as a result of receiving this electronic communication.
Replies to this E-mail may be monitored for operational or business reasons. London Scottish Bank PLC is authorised and regulated by the Financial Services Authority.
London Scottish Bank plc, Registered Office: 201 Deansgate, Manchester M3 3NW Registered Number 973008 England.
Subsidiary Companies:-
London Scottish Finance Limited, Registered Office: 201 Deansgate, Manchester M3 3NW Registered Number 233259 England.
London Scottish Broking Limited, Registered Office: 201 Deansgate, Manchester M3 3NW Registered Number 230110 England.
Robinson Way & Company Limited, Registered Office: 201 Deansgate, Manchester M3 3NW Registered Number 885896 England.
______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: VisitorFieldValidator - different validation scenarios
Posted by Laurie Harper <la...@holoweb.net>.
Gundersen, Richard wrote:
> Hi
>
> I'm using the VisitorFieldValidator (annotations) to push validation
> over to my model object in my Action.
>
> However, I want the validation rules in my model object to work
> differently depending on which Action method is being called.
>
> What's the best way of doing this please?
I don't think you can in that scenario. It might be possible to combine
VisitorFieldValidator annotations with action/method specific rules (via
annotation or XML), in which case you could set up your model
validations to enforce invariants (e.g. required validation for
properties that are always required, but not for those that are only
required with certain methods) and use action or action/method level
validations for the variant requirements. I haven't tried this, though,
so unless someone who has can offer some advice, you'll have to
experiment a bit to see what works.
L.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org