Initalization of Class properties by Spring

I need to initialize a property of a class , which contains a path to a folder.

I used this property within the default constructor of the class.

it seems that Spring does not initialize this property before it executes the constructor, thus i get a crash with NullPointerException.


Alternatively i need to get a relative path to that Sprin bean, which runs under Tomcat. Had this been a Servlet, there would be no problem to get relative path. But how do i achieve same result with Spring ?