1,jsp头部导入下面的包
<%@page import="org.springframework.context.ApplicationContext"%>
<%@page import=
"org.springframework.web.context.support.WebApplicationContextUtils"%>
2,获取context变量
ApplicationContext context = WebApplicationContextUtils. getWebApplicationContext(application);
3,获取bean
ShowService showService = (ShowService)context.getBean("showService");