FAQ Database Discussion Community

## ant time format backslash issue

date,ant,properties-file

## Resource and properties file management issue

java,spring,resources,properties-file
I am trying to learn spring. I have some trouble to manage my resource and properties file. This is my mvc-dispatcher-servlet.xml file. <beans xmlns="http://www.springframework.org/schema/beans" xmlns:context="http://www.springframework.org/schema/context" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:mvc="http://www.springframework.org/schema/mvc" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd...

## java.lang.IllegalArgumentException: 'hello' does not contain an equals sign

java,apache-commons,properties-file
I am currently using the Apache commons configuration library to write and read data from a file. I am able to save the key value pair colors=hello to the user..properties file, but when i try to read the value is get the below exception. Exception in thread "main" java.lang.IllegalArgumentException: 'hello'...

## How do you populate a displaytag column title with a Struts2 properties file entry?

struts2,displaytag,properties-file
In Struts2 you can populate a label for a component with a value from a properties file. The properties file must have the same name as the Struts2 Action Class that will serve up the JSP and be in the same folder as that Action Class. <s:textfield key="field.label.casereference" name="caseReference" />...

## Inject values from messages.properties into ValidationMessages.properties

java,spring,hibernate,hibernate-validator,properties-file
I need to change the @NotNull message used by hibernate-validator. Have successfully done this using a line in ValidationMessages.properties, e.g: javax.validation.constraints.NotNull.message=my validation message. However, this isn't quite what's needed. Will spare the details about why but all these messages should originate from a single messages.properties file, whose purpose is not...

## Why Ant add an equal character in properties file

encoding,ant,properties-file
I have a some given properties file like this : firstvalue=1 secondvalue=hello I use this Ant script to change a value : <propertyfile file="A.properties"> <entry key="firstvalue" value="2" /> </propertyfile> After executing the script, the properties file is now : #Wed, 20 May 2015 11:42:46 +0200 = firstvalue=2 secondvalue=hello I understand...

## How can I retrieve an external .properties file in Java?

java,file,java-ee,inputstream,properties-file
Hello to everybody I have the following problem trying to load a properties file from a directory that is external to my project. So my project have the following structure: PROJECT-ROOT | | |-----> confi | |------> src | | |------> mainPkg (the package name) | | |------> Main (the...

## Constants and properties in java

java,configuration,constants,config,properties-file
Java best practices recommends read properties as constants. So, what do you think is the best approach to reach it? My approach is: A Configuration class to read the properties file only one time (singleton pattern) and use this class to read properties when needed as constants. And a Constants...