jsp中获取bean

ServletContext context = request.getSession().getServletContext();

ApplicationContext ctx = WebApplicationContextUtils.getWebApplicationContext(context);

UserService us = (UserService)ctx.getBean("UserService");

你可能感兴趣的:(jsp中获取bean)