Results 1 to 1 of 1
- 10-04-2007, 09:18 PM #1
How to set the property of Bean by constructor injection
This tip shows the way to set the property of the bean by constructor injection.
The following code is used for setting the property.Java Code:public class sample{ String name; public sample(String a) { name = a; } }
Java Code:<bean id="bean1" class="sample"> <constructor-arg> <value>Sample Bean Value</value> </constructor-arg> </bean>
Similar Threads
-
How to set the property of Bean by constructor injection
By Java Tip in forum Spring FrameworkReplies: 1Last Post: 05-05-2008, 09:01 AM -
How to decide whether to use Setter injection or constructor injection in your code
By Java Tip in forum Java TipReplies: 0Last Post: 03-29-2008, 12:38 PM -
How to use Setter Injection and Constructor Injection
By Java Tip in forum Java TipReplies: 0Last Post: 03-29-2008, 12:38 PM -
How to decide whether to use Setter injection or constructor injection in your code
By JavaBean in forum Java TipReplies: 0Last Post: 09-26-2007, 08:29 PM -
How to use Setter injection and constructor injection
By JavaBean in forum Java TipReplies: 0Last Post: 09-26-2007, 08:28 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks