Questions tagged [properties-file]

A .properties file is either a simple text file or an XML file containing pairs of keys and values. Java and related technologies frequently use .properties files to store configuration information.

Properties files can also be used to store Strings for Internationalization and Localization and error messages.

and related technologies frequently use properties files.

Further Reading:

1316 questions
0
votes
3 answers

how to access the .properties file in ant if it is in different location

this is valid if build.properties file is in root of project.now if the Build.properties file is in src folder and build.xml is in root(main project root).then what will be the syntax to access that…
0
votes
1 answer

Is it possible to drive the @Size "max" value from a properties file?

I'm using Spring 3.1.1.RELEASE. I have a model with the following attribute import javax.validation.constraints.Size; @Size(max=15) private String name; I validate the model in my controller my running @RequestMapping(value = "/save", method =…
Dave
  • 15,639
  • 133
  • 442
  • 830
0
votes
2 answers

Access Resource Bundle from properties file in JSF osgi bundle webapp

I am getting an HTTP 500 error from server when i try to read the properties file in a JSF page. Reading Bundle from class file is working though. Below is the structure of my Sample webapp which is an osgi bundle in Tomcat. The class path in…
Dhirendra Khanka
  • 759
  • 1
  • 8
  • 21
0
votes
1 answer

How to populate JDBC connection string details using properties file

I have code that defines a JDBC connection string with driver name, host, schema, and other details. I want to genericize the process of creating this connection string by populating these values from a properties file. String url =…
Muthukumar
  • 93
  • 2
  • 3
  • 10
0
votes
1 answer

Default and user-supplied property files w/ Spring

I'd like to allow my Spring 3.1.2 application to load configuration properties from a default properties file embedded within my jar and additionally allow the user to specify the path to an overriding properties file as a command line parameter. I…
HolySamosa
  • 9,011
  • 14
  • 69
  • 102
0
votes
3 answers

updating a properties file in a web application

I have a properties file (under rsources folder) in which I'm stocking a variable (key=value), I need to update it when a user insert a new value or update the older one , so can I do it? I have doubts because it's a web application so it' simply a…
Amira
  • 3,184
  • 13
  • 60
  • 95
0
votes
3 answers

Is this the best way to keep .properties file out of WAR file?

To externalize a .properties file, currently I am keeping it in a file system say C:\test\UI\properties and I have created a Environment variable $PROP_LOCATION which points to above file location. So whenever I need to change properties, just I…
Pradeep Simha
  • 17,683
  • 18
  • 56
  • 107
0
votes
0 answers

Struts2: loading a list of values in a properties file

I have a special action that loads pages that extends the ActionSupport class. This allows me to access properties file values using the getText() method. My action requires a list of files to be loaded for any page. I know that this is possible…
Colenso Castellino
  • 900
  • 2
  • 13
  • 23
0
votes
2 answers

To set values from .properties file into web.xml

I have a web.xml file and i want to read multiple values from the properties file into web.xml. Is this possible? . And if yes,How?.Can I access this properties file in java class itself? I am specifically using ant to build my project up. Any help…
Apurv Nerlekar
  • 2,310
  • 1
  • 21
  • 29
0
votes
2 answers

Does 'blanc' have a special meaning, or does the author of org.apache.commons.configuration.PropertiesConfigurationLayout have a typing impediment?

Apache commons configuration has a class called PropertiesConfigurationLayout that has methods like getBlancLinesBefore(). I assume this is intentional, since it is very consistent. The comment says "Returns the number of blanc lines before this…
0
votes
1 answer

Embedded tomcat won't resolve Spring application resource bundle for message source

I am experiencing trouble with my embedded tomcat: when I run my Spring app using the embedded Tomcat, it seems the properties are not resolved. Even if the properties file are loaded: INFO …
balteo
  • 23,602
  • 63
  • 219
  • 412
0
votes
1 answer

Argument to message in properties file not being resolved by Spring

I have the following key/message in a properties file: kadjoukor.registration.form.successMessage=You've been successfully registered. An email has been sent to {0}. Please activate your registration by consulting your email. In my…
balteo
  • 23,602
  • 63
  • 219
  • 412
0
votes
1 answer

how to place properties file in a directory in the classpath ahead of .jar in eclipse?

I want to place ABC.properties file in a directory in the classpath ahead of cmbview81.jar . cmbview81.jar already has ABC.properties file in it. I extracted the file made some changes and made new ABC.properties file and now want to set its path…
happy
  • 2,550
  • 17
  • 64
  • 109
0
votes
1 answer

How come the propertiesFile task in ant will will change the order of properties in the file?

Take a properties files like #File One #Section One sect1.number=Test1 sect1.sample=Test2 sect1.test=Test3 #Section Two sect2.number=Test1 sect2.sample=Test2 sect2.test=Test3 After running this ant:
GC_
  • 1,673
  • 6
  • 23
  • 39
0
votes
1 answer

What is the best practice regarding large localization properties files?

From a performance and memory point of view, what is the best practice regarding localization properties files? A few large files or many small files? Use properties files or compiled property class files? Example scenario: I have an application…
Allan
  • 11
  • 2