springMVC中使用ajax有两种方法,第一种是根据servletAPI来使用ajax,第二种是根据springMVC给我们提供的API来使用。

一.根据servletAPI:

springMVC配置文件如下:

<!-- 配置handerAdapter  适配器 -->
    <bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter"/>
    
    <!-- spring容器扫描指定包下的所有类,如果类上有注解  那么根据注解产生相应bean对象已经映射信息 -->
    <context:component-scan base-package="cn.sxt.controller"/>
View Code

相关文章:

  • 2021-10-01
  • 2022-12-23
  • 2021-07-08
  • 2021-10-16
  • 2021-04-13
  • 2022-02-07
  • 2021-07-18
  • 2022-01-10
猜你喜欢
  • 2021-12-26
  • 2021-06-11
  • 2021-10-24
  • 2021-09-06
  • 2022-01-18
  • 2021-12-18
  • 2021-12-30
相关资源
相似解决方案