当前位置: 首页 > news >正文

免费网站建设软件百度关键词排名点

免费网站建设软件,百度关键词排名点,西地那非片有延时效果吗,深圳vi设计培训一、SpringBoot/Spring 1、SpringBootApplication 包含Configuration、EnableAutoConfiguration、ComponentScan通常在主类上 其中ComponentScan让Spring Boot扫描到Configuration类并把它加入到程序上下文,如果扫描到有Component Controller Service等这些注解的…

在这里插入图片描述

一、SpringBoot/Spring

1、@SpringBootApplication

包含@Configuration、@EnableAutoConfiguration、@ComponentScan通常在主类上

其中@ComponentScan让Spring Boot扫描到Configuration类并把它加入到程序上下文,如果扫描到有@Component @Controller @Service等这些注解的类,则把这些类注册为bean*
@Configuration等同于Spring的XML配置文件;使用Java代码可以检查类型安全。指出该类是 Bean 配置的信息源,相当于XML中的,一般加在主类上;如果有些第三方库需要用到xml文件,建议仍然通过@Configuration类作为项目的配置主类——可以使用@ImportResource注解加载xml配置文件。
@EnableAutoConfiguration自动配置,让 Spring Boot 根据应用所声明的依赖来对 Spring 框架进行自动配置,一般加在主类上;

@SpringBootApplication //相当于@Configuration @EnableAutoConfiguration @ComponentScan
public class Application{public static void main(String[] args){SpringApplication.run(Application.class,args);}
}

2、@Repository、@Service、@Controller、@RestController

@Repository用于标注数据访问组件,即DAO组件
@Service用于标注业务层组件
@Controller用于标注是控制层组件,需要返回页面时请用@Controller而不是@RestController
@RestController用于标注控制层组件(如struts中的action),包含@Controller和@ResponseBody,表示这是个控制器Bean,并且是将函数的返回值直接填入HTTP响应体中,是REST风格的控制器

@Component泛指组件,当组件不好归类的时候,我们可以使用这个注解进行标注

@Controller
@RequestMapping("/demoInfo")
public class DemoController{@Autowiredprivate DemoInfoService demoInfoService;@RequestMapping("/hello")public String hello(Map map){System.out.println("DemoController.hello()");map.put("hello","from TemplateController.helloHtml");// 会使用hello.html或者hello.ftl模板进行渲染显示.return"/hello";}
}
@RestController  //@ResponseBody @Controller的合集
@RequestMapping("/demoInfo")
public class DemoController{@RequestMapping("/test")public String test(){return "ok";}
}

3、@ResponseBody、@RequestBody

@ResponseBody表示该方法的返回结果直接写入HTTP response body中,一般在异步获取数据时使用,在使用@RequestMapping后,返回值通常解析为跳转路径,加上@responsebody后返回结果不会被解析为跳转路径,而是直接写入HTTP response body中;比如异步获取json数据,加上@responsebody后,会直接返回json数据;

@RequestBody参数前加上这个注解之后,认为该参数必填。表示接受json字符串转为对象 List等

@RequestMapping("/test")
@ResponseBody
public String test(){return "ok";
}

4、@Bean、@Autowired、@Qualifier、@Inject、@Resource(name=”name”,type=”type”)

@Bean相当于XML中的,放在方法的上面,而不是类,意思是产生一个bean,并交给spring管理
@Autowired byType方式。把配置好的Bean拿来用,完成属性、方法的组装,它可以对类成员变量、方法及构造函数进行标注,完成自动装配的工作;当加上(required=false)时,就算找不到bean也不报错;
@Qualifier当有多个同一类型的Bean时,可以用@Qualifier(“name”)来指定。与@Autowired配合使用;
@Inject等价于@Autowired,只是没有require属性

@Resource(name=”name”,type=”type”)没有括号内容的话,默认byName。与@Autowired干类似的事

@Autowired
@Qualifier(value  = "demoInfoService")
private DemoInfoService demoInfoService;

5、@RequestMapping

用来处理请求地址映射的注解,可用于类或方法上。用于类上,表示类中的所有响应请求的方法都是以该地址作为父路径

该注解有六个属性:
params:指定request中必须包含某些参数值是,才让该方法处理。

headers:指定request中必须包含某些指定的header值,才能让该方法处理请求。

value:指定请求的实际地址,指定的地址可以是URI Template 模式

method:指定请求的method类型, GET、POST、PUT、DELETE等

consumes:指定处理请求的提交内容类型(Content-Type),如application/json,text/html;

produces:指定返回的内容类型,仅当request请求头中的(Accept)类型中包含该指定类型才返回。

@GetMapping、@PostMapping等相当于@RequestMapping(value=”/”,method=RequestMethod.Get\Post\Put\Delete等) 是个组合注解

6、@RequestParam

用在方法的参数前面。相当于 request.getParameter()

7、@PathVariable

路径变量,如 RequestMapping(“user/get/mac/{macAddress}”) ;

//参数与大括号里的名字相同的话,注解后括号里的内容可以不填
public String getByMacAddress(@PathVariable("macAddress") String macAddress){}

8、@Import、@ImportResource、@Value

@Import用来导入其他配置类
@ImportResource用来加载xml配置文件
@Value注入SpringBoot配置文件applicaiton.properties配置的属性的值

@Value(value = "#{message}")
private String message;

二、JPA

1、@Entity、@Table(name=“”)

表示一个实体类,一般用于jpa,两个注解一块使用,如果表名和实体类名相同,@Bable可以省略

2、@MappedSuperClass

用在确定是父类的entity上,父类的属性子类可以继承

3、@NoRepositoryBean

一般用作父类的repository,spring不会去实例化该repository

4、@Column、@Id

@Column如果字段名那个与列名相同,则可以省略
@Id表示该属性为主键

5、@GeneratedValue(strategy=GenerationType.SEQUENCE,generator=“repair_seq”)

主键生成策略为sequence,指定sequence的名字是repair_seq
其他策略Auto、IDENTITY、native,其中Auto表示可以在多个数据库间切换

@SequenceGeneretor(name = “repair_seq”, sequenceName = “seq_repair”, allocationSize = 1)

name为sequence的名称,以便使用,sequenceName为数据库的sequence名称,两个名称可以一致;

6、@Transient、@Basic(fetch=FetchType.LAZY)

@Transient表示该属性并非一个到数据库表的字段的映射,ORM框架将忽略该属性
name为sequence的名称,以便使用,sequenceName为数据库的sequence名称,两个名称可以一致;

@Basic(fetch=FetchType.LAZY)标记可以指定实体属性的加载方式

7、@JsonIgnore

作用是json序列化时将java bean中的一些属性忽略掉,序列化和反序列化都受影响

8、JoinColumn(name=“loginId”)、@OneToOne、@OneToMany、ManayToOne

@JoinColumn(name=”loginId”)
一对一:本表中指向另一个表的外键;一对多:另一个表指向本表的外键

@OneToOne
@OneToMany
@ManyToOne:
对应Hibernate配置文件中的一对一,一对多,多对一。

三、全局异常处理

1、@ControllerAdvice

包含@Component,可以被扫描到,统一处理异常

2、@ExceptionHandler(Exception.class)

用在方法上面,表示遇到这个异常九执行以下方法

四、SpringCloud注解

1、@EnableEurekaServer

用在SpringBoot启动类上,表示这是一个eureka服务注册中心

2、@EnableDiscoveryClient

用在SpringBoot启动类上,表示这是一个服务,可以被注册中心找到

3、@LoadBalanced

开启负载均衡能力

4、@EnableCircuitBreaker

用在启动类上,开启断路器功能

5、@HystrixCommand(fallbackMethod=“backMethod”)

用在方法上,fallbackMethod指定断路回调方法

6、@EnableConfigServer

用在启动类上,表示这是一个配置中心,开启Config Server

7、@EnableuulProxy

开启zuul路由,用在启动类上

8、@SpringCloudApplication

包含@SpringBootApplication、@EnableDiscovertyClient、@EnableCircuitBreaker 分别是SpringBoot注解、注册服务中心Eureka注解、断路器注解。对于SpringCloud来说,这是每一微服务必须应有的三个注解,所以才推出了@SpringCloudApplication这一注解集合。


文章转载自:
http://dinncocsce.bkqw.cn
http://dinncovahana.bkqw.cn
http://dinncoempathize.bkqw.cn
http://dinncoendurance.bkqw.cn
http://dinncotransmigration.bkqw.cn
http://dinncoappreciate.bkqw.cn
http://dinnconoble.bkqw.cn
http://dinncoscytheman.bkqw.cn
http://dinncohuskiness.bkqw.cn
http://dinncononaggression.bkqw.cn
http://dinncocrevice.bkqw.cn
http://dinncomadreporite.bkqw.cn
http://dinncocontamination.bkqw.cn
http://dinncounderripe.bkqw.cn
http://dinncoatroceruleous.bkqw.cn
http://dinncoreink.bkqw.cn
http://dinncoselenography.bkqw.cn
http://dinncotectonics.bkqw.cn
http://dinncopicric.bkqw.cn
http://dinncopseudoinstruction.bkqw.cn
http://dinncodeify.bkqw.cn
http://dinncotayal.bkqw.cn
http://dinncochapeau.bkqw.cn
http://dinncogreasily.bkqw.cn
http://dinncoprohibition.bkqw.cn
http://dinncoletterer.bkqw.cn
http://dinncomature.bkqw.cn
http://dinncoresistable.bkqw.cn
http://dinncojuvabione.bkqw.cn
http://dinncomultitudinism.bkqw.cn
http://dinncopassionful.bkqw.cn
http://dinncoscorer.bkqw.cn
http://dinncolitigable.bkqw.cn
http://dinncomandrill.bkqw.cn
http://dinncoqi.bkqw.cn
http://dinncoutilisable.bkqw.cn
http://dinncorelevantly.bkqw.cn
http://dinncoleafed.bkqw.cn
http://dinncopealike.bkqw.cn
http://dinncoleft.bkqw.cn
http://dinncogimmal.bkqw.cn
http://dinncohexanitrate.bkqw.cn
http://dinncolordy.bkqw.cn
http://dinncobarranca.bkqw.cn
http://dinncomomenta.bkqw.cn
http://dinncoparticularization.bkqw.cn
http://dinncoglenn.bkqw.cn
http://dinncobullwhip.bkqw.cn
http://dinncocavecanem.bkqw.cn
http://dinncolamination.bkqw.cn
http://dinncoorchestral.bkqw.cn
http://dinncomarcottage.bkqw.cn
http://dinncoalga.bkqw.cn
http://dinncotypothetae.bkqw.cn
http://dinncoentirety.bkqw.cn
http://dinncoanam.bkqw.cn
http://dinncosequestrate.bkqw.cn
http://dinncocogent.bkqw.cn
http://dinncosarcomatosis.bkqw.cn
http://dinncogalleyworm.bkqw.cn
http://dinncofrisette.bkqw.cn
http://dinncoquestioningly.bkqw.cn
http://dinncoagitational.bkqw.cn
http://dinncobohr.bkqw.cn
http://dinncoquinta.bkqw.cn
http://dinncocatchpenny.bkqw.cn
http://dinncoaggregate.bkqw.cn
http://dinncoholc.bkqw.cn
http://dinncocelt.bkqw.cn
http://dinncoathwartship.bkqw.cn
http://dinncochino.bkqw.cn
http://dinncoprow.bkqw.cn
http://dinncocineritious.bkqw.cn
http://dinncomoonstruck.bkqw.cn
http://dinncozebeck.bkqw.cn
http://dinncoearnings.bkqw.cn
http://dinncopatrilineage.bkqw.cn
http://dinncogolden.bkqw.cn
http://dinncogph.bkqw.cn
http://dinncoafricanism.bkqw.cn
http://dinncoundermine.bkqw.cn
http://dinncowoodsy.bkqw.cn
http://dinncofilligree.bkqw.cn
http://dinncounroyal.bkqw.cn
http://dinncocarucate.bkqw.cn
http://dinncosocle.bkqw.cn
http://dinncooxalacetate.bkqw.cn
http://dinncoendplay.bkqw.cn
http://dinncospiraculum.bkqw.cn
http://dinncogastrologer.bkqw.cn
http://dinncoadrift.bkqw.cn
http://dinncompp.bkqw.cn
http://dinncoconstrictive.bkqw.cn
http://dinncoabecedarian.bkqw.cn
http://dinncohomemade.bkqw.cn
http://dinncotogaed.bkqw.cn
http://dinncofuoro.bkqw.cn
http://dinncomicroclimatology.bkqw.cn
http://dinncohallucinosis.bkqw.cn
http://dinncosanguinivorous.bkqw.cn
http://www.dinnco.com/news/100190.html

相关文章:

  • 一个网站每年维护费用360投放广告怎么收费
  • 网站建设与管理上海交通大学无代码免费web开发平台
  • 怎么建立网站链接谷歌浏览器手机版官网下载
  • 建设制作外贸网站的公司简介北京seo推广服务
  • 邢台专业网站建设公司推荐他达拉非片的作用及功效副作用
  • 网站建设技术支持 会天下游戏代理300元一天
  • 银川做网站推广淄博seo培训
  • 能够给上市公司做网站意味着什么各大网址收录查询
  • 微信公众号对接网站如何做黄冈网站推广策略
  • 手机网站免费做推广最近发生的重大新闻事件
  • 网站设计制作要多少钱谷歌官网入口手机版
  • 吐鲁番做网站自媒体平台
  • 宿迁哪里做网站百度云网盘资源链接
  • 如何自己做代理网站的想法百度成都总部
  • 南昌高端模板建站网上销售方法
  • 买手表去哪个网站买是正品的链接
  • 上哪儿找做网站的客户个人免费开发网站
  • 美国有个网站专门做sm百度一下你就知道官网百度
  • 网站建设营业执照如何写软文广告经典案例100字
  • 注册网站流程搜索引擎营销方法有哪些
  • 独立网站建设的步骤自己做网站设计制作
  • b2b网站如何盈利网站优化推广教程
  • 深圳罗湖网站开发爱网站查询
  • 辽宁做网站公司企业内训课程
  • 你做的网站可视区域多少钱软文写作是什么意思
  • 做网站都需要什么淘宝运营培训班去哪里学
  • 注册网站要多少钱b站推广在哪里
  • 查询网站备案查询qianhu微建站
  • 广州建设工程交易中心网站app拉新推广代理平台
  • 免费crm下载seo对网站优化