5.学习springmvc响应json数据
一.配置不过滤静态资源文件:用来访问webapp中js,css,images文件 1.修改springmvc.xml 1 <!-- 配置前端控制器,用于设置哪些资源不拦截 --> 2 < mvc:resources location ="/css/" mapping ="/css/**" /> <!-- 样式 --> 3 < mvc:resources location ="/images/" mapping ="/images/**" /> <!-- 图片 --> 4 < mvc:resources location ="/js/" mapping ="/js/**" /> <!-- javascript --> 2.jsp: 1 <% @ page contentType = " text/html;charset=UTF-8 " language = " java " %> 2 3 < html > 4 < head > 5 < title > response </ title > 6 < script src ="js/jquery.min.js" ></ script > 7 < script > 8 // 页面加载,绑定点击事件 9 $( function () { 10 $( " #btn " ).click( function () { 11 alert( "