struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Umesh Awasthi <>
Subject Fwd: Preferred Way to Inject Dependency in plugin
Date Sat, 01 Dec 2012 09:17:33 GMT
Any inputs on below mentioned problem?

Hi All,

I am creating a plugin to enable JSR303 validation, idea is to provide a
generic interface and let user provide which bean Validator they want to
use be it Hibernate Bean Validator or Apache one or any other which follow

I was thinking about what can be best way to inject that provider in my

I checked how Spring's  LocalValidatorFactoryBean
doing this, they have a default implementation but provide a way to let use
inject there own bean validation provider

private Class providerClass;

public void setProviderClass(Class<? extends ValidationProvider>
providerClass) {

this.providerClass = providerClass;


What can be possible and best way to achieve this?
I do not want to use any other external API to add extra dependency

With Regards
Umesh Awasthi

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message