I have two diff POJOs(Bean Classes) and i need to have diff date format for each bean. Do i need to initialize the SimpleDateFormat twice with diff Ids so that my two POJOs can use the two date formats?
<bean id="dateFormatEmployee" class="java.text.SimpleDateFormat">
<constructor-arg value="mm-dd-yy"></constructor-arg>
<constructor-arg value="true" />
</bean>
<bean id="dateFormatUser" class="java.text.SimpleDateFormat">
<constructor-arg value="dd-mm-yyyy"></constructor-arg>
<constructor-arg value="true" />
</bean>
<bean id="employee" class="com.kranti.springcore.Employee">
<constructor-arg name="dob">
<bean factory-bean="dateFormatEmployee" factory-method="parse">
<constructor-arg value="12-20-90"></constructor-arg>
</bean>
</constructor-arg>
</bean>
<bean id="user" class="com.kranti.springcore.User">
<constructor-arg name="dob">
<bean factory-bean="dateFormatUser" factory-method="parse">
<constructor-arg value="20-12-1995"></constructor-arg>
</bean>
</constructor-arg>
</bean>