How can I make properties in properties files mandatory in Spring?

Posted by Paulo Guedes on Stack Overflow See other posts from Stack Overflow or by Paulo Guedes
Published on 2010-05-04T10:55:28Z Indexed on 2010/05/04 11:08 UTC
Read the original article Hit count: 232

Filed under:
|
|

I have an ApplicationContext.xml file with the following node:

<context:property-placeholder 
location="classpath:hibernate.properties, classpath:pathConfiguration.properties" />

It specifies that both properties files will be used by my application.

Inside pathConfiguration.properties, some paths are defined, such as:

PATH_ERROR=/xxx/yyy/error
PATH_SUCCESS=/xxx/yyy/success

A PathConfiguration bean has setters for each path.

The problem is: when some of those mandatory paths are not defined, no error is thrown. How and where should I handle this problem?

© Stack Overflow or respective owner

Related posts about spring

Related posts about java