dawdler-client-plug-web
模块介绍
webmvc模块,使用上基本与spring mvc一致.提供远程加载组件的客户端,远程加载组件通知器,web监听器,web拦截器,aop实现.
1. pom中引入依赖
<groupId>club.dawdler</groupId>
<artifactId>dawdler-client-plug-web</artifactId>
2. webmvc框架使用方法
2.1 创建Controller
编写一个Controller类上加入注解@Controller.
2.2 创建API
通过RequestMapping定义webApi,RequestMapping可以用在类上和方法上,也可以用在类上,用在某个类上那么所有webApi的开头都必须以用在类上定义的RequestMapping开头.(RequestMapping用在类上只有value有效,其余无效)
3. Controller注解
3.1 标识注解介绍
注解 | 作用域 | 描述 |
---|---|---|
@Controller | 类 | 标识一个类为Controller |
@RequestMapping |