In my Spring 3.0 app, I have some resources in /WEB-INF/dir. At runtime I need some of them as an InputStream (or some other type). How can I retri
All ApplicationContexts are, by definition, ResourceLoaders. This means that they are capable of resolving any resource strings found within their configuration. With this in mind, you can declare your target bean with a setter that accepts an org.springframework.core.io.Resource. Then when you configure the target bean, just use a resource path in the value for the property. Spring will attempt to convert the String value in your configuration into a Resource.
public class Target {
private Resource resource;
public void setResource(final Resource resource) {
this.resource = resource;
}
}
//configuration