Spring 构造方式注入枚举类型 怎么写
展开全部
package lee;
import
org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
public class BeanTest
{
public static void main(String[] args)throws Exception
{
//创建Spring容器
ApplicationContext ctx = new
ClassPathXmlApplicationContext( bean.xml );
//获取chinese 实例
Person p = (Person)ctx.getBean( chinese );
//调用useAxe()方法
p.useAxe();
import
org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
public class BeanTest
{
public static void main(String[] args)throws Exception
{
//创建Spring容器
ApplicationContext ctx = new
ClassPathXmlApplicationContext( bean.xml );
//获取chinese 实例
Person p = (Person)ctx.getBean( chinese );
//调用useAxe()方法
p.useAxe();
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询