<beans>
<bean id="date" class="java.util.Date"></bean>
</beans>
其中container就是Spring框架的容器:
String idStr = "date";
String classStr = "java.util.Date";
Class clazz = Class.forName(classStr);
Object obj = clazz.newInstance();
container.put(idStr,obj);