Properties « Core Library « Java Articles

Home
Java Articles
1.Build Deploy
2.Class
3.Core Library
4.Data Types
5.Database JDBC
6.Design
7.Development
8.File Input Output
9.Graphics Desktop
10.J2EE Enterprise
11.J2ME Wireless
12.JVM
13.Language
14.Library Product
15.Network
16.Security
17.SOA Web Services
18.Test
19.Web Development
20.XML
Java Articles » Core Library » Properties 

1. Smartly load your properties    javaworld.com

Let's say you need to load a classpath resource that corresponds to a some/pkg/resource.properties file. I use classpath resource to mean something that's packaged in one of the application jars or added to the classpath before the application launches. You can add to the classpath via the -classpath JVM option each time the application starts or by placing the file in the \classes directory once and for all. The key point is that deploying a classpath resource is similar to deploying a compiled Java class, and therein lies the convenience.

2. Escaping Properties Purgatory - Part 1    theserverside.com

In Listing 1, the Properties class is used to specify two name-value pairs that will be passed to the InitialContext constructor. The InitialContext constructor is a JNDI-provided factory method that loads different JNDI providers depending on the parameters passed in.

3. Escaping Properties Purgatory - Part 2    theserverside.com

The current installed based of Java applications includes thousands of shell scripts to correctly set various CCI properties. A wholesale industry switch to XML would require rewriting these scripts. Also, such a switch would be problematic where pre-1.4 versions of Java are still in use. So, XML cannot be a complete solution. A general-purpose CCI will need a backwards-compatibility mode that includes the various ad hoc solutions currently in place, without encouraging their continued use in the future.

java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.