title: Springframework constructor-arg
body: <p>I have a MainClass which have 2 variables.  I would like to pass those 2 values to a springframework bean class "Test".  how do I define that in applicationContext.xml and also how do I pass those 2 variable values to the bean "Test".</p>
  
  <p>Ex:</p>
  
  <pre><code>class MainClass {
         public int var1;
        public int var2;
        public Test test;
  
     public void setVar1(int var11) {
      var1 = var11;
     }
  
      public void setVar2(int var22) {
          var2 = var22;
      }
  
     public static void main(String args[]) {
  
         ApplicationContext context = 
             new FileSystemXmlApplicationContext("applicationContext.xml");
        Test = context.getBean("test");
     }
    }
  </code></pre>
  
  <p>------------ TEST class ------------</p>
  
  <pre><code>public class Test {
  
   public Test (int var1, int var2) {}
  }
  </code></pre>
  
  <p>------------- applicationContext.xml -------------</p>
  
  <pre><code>   &lt;bean id="test" class="com.path.test"&gt;
         &lt;constructor-arg index="0" type="int" value="????"/&gt;
         &lt;constructor-arg index="1" type="int" value="????"/&gt;
     &lt;/bean&gt;
  </code></pre>