title: How to pass UniqueID as constructor args to a spring bean
body: <p>I am  a new to spring. I have a bean class with a constructor having single parameter, a uniqueId. </p>
  
  <pre><code>void Sample(String uniqueId){
        this.uniqueId = uniqueId;
  }
  </code></pre>
  
  <p>the bean doesn't have any default constructor.
  I require this id for some bussiness logic.
  this uniqueID needs to be UUID.randomUUID().toString().</p>
  
  <p>How can pass this to the bean from the bean configuration xml.</p>
  
  <pre><code>&lt;bean id="Sample" class="com.scribe.dao.Sample"&gt;
       &lt;constructor-arg  value="UUID.randomUUID().toString()"/&gt;               
  &lt;/bean&gt;
  </code></pre>
  
  <p>this doesn't work. What are my other options?
  I have also seen an example like this in another post on <a href="https://stackoverflow.com/a/25306467/3492866">stackoverflow</a>.<code>&lt;constructor-arg value="uniqueId"/&gt;</code>
  but the same didnot work for me.Is there any easyway to do this.
  any help appreciated.</p>