You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Alec C4 <al...@gmail.com> on 2008/06/03 15:48:19 UTC
Spring bean access from custom validation
Hi,
i'm trying to understand - how to access some spring bean from my custom
validation. Could you please explain me - how to do it?
--
View this message in context: http://www.nabble.com/Spring-bean-access-from-custom-validation-tp17623952p17623952.html
Sent from the Struts - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Spring bean access from custom validation
Posted by Randy Burgess <RB...@nuvox.com>.
If Spring works with validators the way it does with interceptors and
actions, which I assume it does, then one way you could do this is to define
your validator as a spring bean:
<validators>
<validator name="aSpringValidator" class="springValidator"/>
</validators>
springValidator would be the id of your spring managed bean. Then you would
inject any dependencies into that spring bean using normal methods,
depending on the version of spring you are using, i.e. XML or annotations.
I've had issues with auto-wiring on WebLogic so I do things this way.
Regards,
Randy Burgess
Sr. Web Applications Developer
Nuvox Communications
> From: Alec C4 <al...@gmail.com>
> Reply-To: Struts Users Mailing List <us...@struts.apache.org>
> Date: Tue, 3 Jun 2008 06:48:19 -0700 (PDT)
> To: <us...@struts.apache.org>
> Subject: Spring bean access from custom validation
>
>
> Hi,
> i'm trying to understand - how to access some spring bean from my custom
> validation. Could you please explain me - how to do it?
> --
> View this message in context:
> http://www.nabble.com/Spring-bean-access-from-custom-validation-tp17623952p176
> 23952.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
This email and any attachments ("Message") may contain legally privileged and/or confidential information. If you are not the addressee, or if this Message has been addressed to you in error, you are not authorized to read, copy, or distribute it, and we ask that you please delete it (including all copies) and notify the sender by return email. Delivery of this Message to any person other than the intended recipient(s) shall not be deemed a waiver of confidentiality and/or a privilege.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org