Leer archivo de propiedades

There are 4 projects.

  1. project1
  2. project2
  3. project3
  4. project4

Project2 has 2 projects in build path. i.e. project1 y project3

Project1 has a class that reads property from a properties file. Project2 can access that class to getProperty.

project4 tiene solo uno project3 in its build path.

Significa project3 is in build path of two projects.

I want to get property in project4. I have no choice to include project1 in project4. Whatelse can I do to get property?

Can I do one think like: While starting project2. Load a list with properties in project3. Then access that from project4?

preguntado el 02 de febrero de 12 a las 11:02

You have to include project1 in build path of project4. No other option is there because the class that reads properties file is in project1. -

1 Respuestas

As proyecto 2 can have access to classes in proyecto 1, so an interface will be created in proyecto 3. Una clase in project 2 will implement this interface having function to read property from properties file. proyecto 4 is in shared library of proyecto 2. Spring does a trick. A method in project 4 gets bean through applicationcontext, of that clase which was created in proyecto 2. After getting this bean, property can be accessed.

Respondido 29 Feb 12, 14:02

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.