spring3的JAR包与注解学习笔记

一.spring包分析
web

org.springframework.aop- 3.0.0.RELEASE: 面向切面编程,提供AOP实现。ajax


org.springframework.asm- 3.0.0.RELEASE:独立的asm程序,Spring2.5.6的时候须要asmJar 包.3.0开始提供他本身独立的asmJarspring


org.springframework.aspects- 3.0.0.RELEASE:提供对AspectJ框架的整合express


org.springframework.beans- 3.0.0.RELEASE:SpringIoc(依赖注入)的实现编程


org.springframework.context.support- 3.0.0.RELEASE:spring-context的扩展支持,用于MVC方面缓存


org.springframework.context- 3.0.0.RELEASE:Spring提供在基础IoC功能上的扩展服务,此外还提供许多企业级服务的支持,如邮件服务、任务调度、JNDI定位、EJB集成、远程访问、缓存以及各类视图层框架的封装等tomcat


org.springframework.core- 3.0.0.RELEASE:Spring的核心工具包服务器


org.springframework.expression- 3.0.0.RELEASE:Spring表达式语言支持包mybatis


org.springframework.instrument.tomcat- 3.0.0.RELEASE:Spring对Tomcat链接池的集成mvc


org.springframework.instrument- 3.0.0.RELEASE:Spring对服务器的代理接口


org.springframework.jdbc- 3.0.0.RELEASE:Spring对JDBC的简单封装


org.springframework.jms- 3.0.0.RELEASE:封装JMS API


org.springframework.orm- 3.0.0.RELEASE:整合第三方的ORM框架,如Hibernate,mybatis等


org.springframework.oxm-3.0.0.RELEASE:Spring对Object/XML的映射支持,能够让Java与xml以前来回切换。


org.springframework.test- 3.0.0.RELEASE:Spring对Junit測試框架的簡單封裝


org.springframework.transaction- 3.0.0.RELEASE:對JDBC,Hibernate,JDO,JPA等提供的一致的聲明式和編程式事務管理


org.springframework.web.portlet- 3.0.0.RELEASE:SpringMVC的增強支持包


org.springframework.web.servlet- 3.0.0.RELEASE:對Javaee Servlet的支持


org.springframework.web.struts- 3.0.0.RELEASE:提供對整合struts框架的支持


org.springframework.web- 3.0.0.RELEASE:SpringWeb下的工具包


mybatis-spring-1.2.1.jar:Spring整合mybatis時的支持包


二.Springmvc经常使用註解說明

@Controller

在類上面定義,代表該類為控制器,返回字符串與redirect:xxx


@RequestMapping(value="" method=XX)

在類或方法上面使用,表示設置URL訪問地址。它有兩個屬性,value指定訪問路徑,method指定請求方式,请求方式在RequestMethod这个类中,所有以常量的形式定义,它默认使用GET请求。


@RequestParam

指定Request请求参数,在方法参数中定义,至关于传统的request.getParameter().


@PathVariable

获取URL访问路径变量,这是Springmvc3.0框架才加入的特性,基于Restful风格的URL访问路径


@ModelAttribute

全局式的方法,在一组URL访问路径中,每次都会执行,方法返回结果保存在module会话中


@Service

在类上面定义,指定被注解的类是业务逻辑组件,若是不指定具体的Bean ID,则采用默认命名方式,即类名的首字母小写.


@Repository

在DAO层的类上使用


@Autowired

IOC自动注入功能,替换之前的set方法


@Qualifier

对同一接口类有不一样实现指定具体的实现类


@ResponseBody

定义在方法上,Ajax调用声明,指定方法返回结果为Ajax回调函数结果。这是spring3.0新增的特性,用来标识ajax调用。


@InitBinder

初始化数据绑定与类型转换,将传入的参数转换为自定义类型,或者对参数进行自定义处理。

相关文章
相关标签/搜索