這是webxml中的配置
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
classpath:application-context.xml </param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<servlet>
<servlet-name>example</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>example</servlet-name>
<url-pattern>/api/*</url-pattern>
</servlet-mapping>
如何通過controller中獲取bean,如果使用ClassPathApplicationContext獲取會報錯,請問該怎么辦???各位大哥誰能幫一下啊
添加回答
舉報
0/150
提交
取消