1

I am new to Spring framework and confused how to load properties of a bean ( Instance variables of a bean ) dynamically . Spring expects to use xml based configuration for declaring all the beans and dependencies between beans . For example ,

public class Bean1
   {
        int value; 
        public void setValue(int thisValue)
        {
             value = thisValue;
         }

   }

<bean id = "LibraryMgmtBean" class = "Bean1">
 <property name = "value" Value = "SampleString"/>   </bean> 

But here we are mentioning all the properties of a bean statically . But , what if I want to supply these values dynamically . I mean , I may get values from a JSP page from weblayer and should pass to this bean . And as all beans are declard in XML this way , how Spring Injects dependecies of other beans when all bean properties are supplied dynamically ?

skaffman
  • 398,947
  • 96
  • 818
  • 769
SriVani B
  • 27
  • 1
  • 6
  • 1
    Do you want this dynamic or do you just want to know how a web app is build? – hellectronic Mar 06 '12 at 09:37
  • Might be both.... It will be helpful if i get any good link that explains these or specifically a good example of web application that built using Spring....... Thanx In advance for d help..... – SriVani B Mar 06 '12 at 16:18

1 Answers1

0

Found answers to my question from threads:

How to collect spring properties from multiple files for use on a single bean

Apply dynamic properties to a bean at runtime

Loading Properties with Spring (via System Properties)

Community
  • 1
  • 1
SriVani B
  • 27
  • 1
  • 6