JQuery之$.ajax()方法属性说明

JQuery的 $.ajax() 方法属性老是记不全记不清,用到时老是去搜索,查到的资料各式各样,大多还得要自己过滤下才是自己想要的,太麻烦了,这就抽个空全部整理并理解下。

阅读更多

Spring MVC之HttpMessageConverter<T>接口

  全路径:org.springframework.http.converter.HttpMessageConverter<T>

  HttpMessageConverter接口负责将请求信息转换为一个T类型的对象,并将T类型对象绑定到请求方法的参数中或输出为响应信息。

  DispatcherServlet默认已经装配配了RequestMappingHandlerAdapter作为HandlerAdapter组件的实现类,即 HttpMessageConvertRequestMappingHandlerAdapter使用,将请求信息转换为对象,或将对象转换为响应信息。

阅读更多

Spring MVC之@ModelAttribute

  @ModelAttribute注解将请求参数绑定到Model对象,只支持一个value属性,类型是String
  该注解的方法会在所有Controller方法执行前执行,所在一个Controller映射多个URL时,谨慎使用。个人认为该注解有些鸡肋。

阅读更多

JSP报错:According to TLD or attribute directive in tag file, attribute items does not accept any expressions

  JSP 在使用forEach标签时报错:According to TLD or attribute directive in tag file, attribute items does not accept any expressions。

原因:web.xmlweb-app_2_5.xsd版本大于2.3,需要使用jstl的扩展标签。
解决:jsp文件引用的jstl core标签库改为扩展标签库,
将:<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core"%>
替换成:<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt"%>
差异:2.5版本可以根据索引 ID 取出 List 里的单个值, 2.3版本就不行。

1
2
3
4
5
6
7
<body>
<!-- 从list集合中根据索引位取值 -->
<h3>${list[0] }</h3>
<h3>${list[1] }</h3>
<h3>${list[2] }</h3>
<h3>${list[3] }</h3>
</body>
阅读更多