Inject primitive properties to Spring bean when using @Autowired?
问题 try to inject myInt of the following through Spring public class MyBean { @Resource (name="myValue") private int myInt; Any idea? I have got the following post. But it don't work for me. I still get the following error message. Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanNotOfRequiredTypeException: Bean named 'myValue' must be of type [int], but was actually of type [java.lang.Integer] Detail: The following is the test servlet that I