Spring bean configuration

I want to specify the file system path as part of the Spring bean configuration. I know I can set a path like:

<bean id="myBean" class="com.example.BeanImpl">
  <property name="path" value="/WEB-INF/jsp"/>
</bean> 

      

The path / WEB-INF / jsp is interpreted as referring to the root of the web application. But how to specify the path relative to the filesystem root e.g. / usr / bin

Cheers, Don

0


source to share


1 answer


Use file: predicate, for example:

<property name="path" value="file:c:/somefolder/someotherfolder"/>



Now that I think about it, its also about what the bean expects. Does it use the path to cast in the browser (which makes the whole file: thing relative on the client machine) or do you use it to programmatically download the file that is on the server?

+1


source







All Articles