issues assigned a value to a variable using a property file
<p>hi all i am having an issue, i have a properties file, this stores all the save locations, i get the data from this file by :</p>

<pre><code>public void loadProp() {
        System.out.println("Loading properties");
        InputStream in = this.getClass().getClassLoader().getResourceAsStream("config.properties"); //points to a properties file, this will load up destinations instead of having to declare them here
        try {
            configProp.load(in);
            System.out.println(configProp.getProperty("destinationPDF"));
            System.out.println(configProp.getProperty("destination"));
            System.out.println(configProp.getProperty("fileList"));
        } catch (IOException e) {
            e.printStackTrace();
        }
        System.out.println("called get username");
        username = FacesContext.getCurrentInstance().getExternalContext().getRemoteUser();
        System.out.println(username);


    }
</code></pre>

<p>i then do this to assign the value to destination </p>

<pre><code>public String destination = configProp.getProperty("destination");
</code></pre>

<p>but whenever i use destination i get a null value, however if i use configProp.getProperty("destination") i get the full path, what am i doing wrong here as i want the value to be point to destination as other classes depend on it</p>

<p>EDIT :</p>

<pre><code>This class is called on by a command button (web app)

    @ViewScoped
    @ManagedBean(name = "fileUploadController")
    public class FileUploadController {

        public boolean isUploadComplete() { //to enable the next button once finished
            return uploadComplete;
        }

        public void setUploadComplete(boolean uploadComplete) {
            this.uploadComplete = uploadComplete;
        }

        public boolean isUploadComplete2() {
            //to disable the file upload button, this will stop users uploading multiple files and over writing them as only the last file uploaded will be used
            return uploadComplete;
        }

        public void setUploadComplete2(boolean uploadComplete) {
            this.uploadComplete = uploadComplete;
        }
        /*
         public void handleFileUpload(FileUploadEvent event) {
         System.out.println("called");
         FacesMessage msg = new FacesMessage("Succesful", event.getFile().getFileName() + " is uploaded.");
         FacesContext.getCurrentInstance().addMessage(null, msg);
         }
         }
         */
        //
        //Strings for fileUpload
        //oadProp() 
        //public String fileList = "D:/Documents/NetBeansProjects/printing~subversion/fileupload/web/resources/Directory Files/directoryFiles.txt"; //
        private Properties configProp = new Properties();

        @PostConstruct
        //System.out.println(destinationPDF);
        //System.out.println(destination);
    // Get the username from the login page, this is used to create a folder for each user
        public void loadProp() {
            System.out.println("Loading properties");
            InputStream in = this.getClass().getClassLoader().getResourceAsStream("config.properties"); //points to a properties file, this will load up destinations instead of having to declare them here
            try {
                configProp.load(in);
                System.out.println(configProp.getProperty("destinationPDF"));
                System.out.println(configProp.getProperty("destination"));
                System.out.println(configProp.getProperty("fileList"));
            } catch (IOException e) {
                e.printStackTrace();
            }
            System.out.println("called get username");
            username = FacesContext.getCurrentInstance().getExternalContext().getRemoteUser();
            System.out.println(username);


        }
//String destinationPDF = configProp.getProperty("destinationPDF"); Always makes a null no idea why yet
    //private String destinationPDF = configProp.getProperty("destinationPDF");
    public String destination = configProp.getProperty("destination");
    private String username;
    //public static String destination = "D:/Documents/NetBeansProjects/printing~subversion/fileupload/uploaded/"; // main location for uploads//TORNADO ONLY //"D:/My Documents/NetBeansProjects/printing~subversion/fileupload/uploaded/"; // USE ON PREDATOR ONLY 
    public static String NewDestination;
    public static String UploadedfileName;
    public static String CompletefileName;
    //
    //Strings for file copy
    //
    //private String destinationPDF = "D:/Documents/NetBeansProjects/printing~subversion/fileupload/web/resources/pdf/"; //USE ON TORNADO//"D:/My Documents/NetBeansProjects/printing~subversion/fileupload/web/resources/pdf/";//USE ON PREDATOR    
    private String NewdestinationPDF;
    public static String PdfLocationViewable;
    private boolean uploadComplete;
    private boolean uploadComplete2;

    //
    public void File() {
</code></pre>

<p>above is the first bit of code for that class</p>

<p>the output in the console is :</p>

<pre><code>INFO: buttonToUploadText invoked
INFO: Loading properties
INFO: D:/Documents/NetBeansProjects/printing~subversion/fileupload/web/resources/pdf/
INFO: D:/Documents/NetBeansProjects/printing~subversion/fileupload/Uploaded/
INFO: D:/Documents/NetBeansProjects/printing~subversion/fileupload/web/resources/Directory Files/directoryFiles.txt
INFO: called get username
INFO: null
INFO: destination is null
</code></pre>
