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?
--
With Regards
Umesh Awasthi
http://www.travellingrants.com/