资源文件可以放在web-inf下的classes下,然后利用util类的ResourceBundle 来load这个资源文件。资源文件应该是以properties结尾,比如config.properties ,然后在加载这个文件的时候只要取它的文件名就可以,而不需要文件的后缀名。资源绑定的具体实现可以参考下面的。
import java.util.*;public class PropertyFile {
    public PropertyFile() {
    }    public static String getValue(String key) {
        ResourceBundle rb = ResourceBundle.getBundle("config");
        String temp = rb.getString(key);
        return temp;
    }}