Without any references to the SErvletContext or HttpServletRequest, you won't be able to retrieve something from /WEB-INF/...
With Spring Dependency Injection however you can rely on Spring's resource infrastructure. If your bean is managed by Spring and located in a WebApplicationContext you could for example do teh following:
Code:
public class ConfigLoader {
private Resource configFile;
public void setConfigFile(Resource res) {
this.configFile = res;
}
}
together with:
Code:
<bean id="configLoader" class="ConfigLoader">
<property name="configFile"><value>/WEB-INF/myconfig.xml</value></property>
</bean>