Thanks!! I am wondering why it is working fine for other case? I was expecting that Struts2 will convert it for me ;)
Thanks Umesh On Wed, Oct 16, 2013 at 12:54 PM, Lukasz Lenart <lukaszlen...@apache.org>wrote: > 2013/10/16 Umesh Awasthi <umeshawas...@gmail.com>: > > I am trying to inject few values to my bean like > > > > @Inject > > public > > > DefaultJSR303ValidationManager(@Inject(value=ValidatorConstants.PROVIDER_CLASS,required=false) > > String providerClassName, > > > > @Inject(value=ValidatorConstants.IGNORE_XMLCONFIGURAITION,required=false) > > boolean ignoreXMLConfiguration > > ) > > { > > // some code > > } > > > > > > Entries from struts-plugin.xml > > > > <constant name="providerClass" value=""/> > > <constant name="ignoreXMLConfiguration" value="false"/> > > > > but i am getting following exception > > > > Caused by: > > com.opensymphony.xwork2.inject.ContainerImpl$MissingDependencyException: > No > > mapping found for dependency [type=boolean, > name='ignoreXMLConfiguration'] > > > > how ever if i change it to > > @Inject > > public > > > DefaultJSR303ValidationManager(@Inject(value=ValidatorConstants.PROVIDER_CLASS,required=false) > > String providerClassName > > ) > > { > > } > > > > @Inject(value=ValidatorConstants.IGNORE_XMLCONFIGURAITION,required=false) > > public void setIgnoreXMLConfiguration( boolean > ignoreXMLConfiguration ) > > { > > this.ignoreXMLConfiguration = ignoreXMLConfiguration; > > } > > > > everything is working fine and dependencies are being injected correctly. > > I am not sure if where i am doing wrong ? > > can't i have multiple @inject inside constructor? > > <constant/> defines String not boolean, try something like this: > > @Inject > public > DefaultJSR303ValidationManager(@Inject(value=ValidatorConstants.PROVIDER_CLASS,required=false) > String providerClassName, > > @Inject(value=ValidatorConstants.IGNORE_XMLCONFIGURAITION,required=false) > String ignoreXMLConfiguration) { > > this. ignoreXMLConfiguration = > "true".equalsIgnoreCase(ignoreXMLConfiguration); > > } > > > Regards > -- > Ćukasz > + 48 606 323 122 http://www.lenart.org.pl/ > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > > -- With Regards Umesh Awasthi http://www.travellingrants.com/