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

南宁网站建设培训学校百度推广页面投放

南宁网站建设培训学校,百度推广页面投放,wordpress自定义分类名称,附近装修公司Spring Boot 常用注解 虽然Spring Boot本身并没有引入大量新的注解,但它基于Spring框架,并整合了多种技术和库,使得开发者可以更方便地使用Spring框架的功能。在Spring Boot项目中,常用的注解主要来自于Spring框架本身。 ‌Sprin…

Spring Boot 常用注解

虽然Spring Boot本身并没有引入大量新的注解,但它基于Spring框架,并整合了多种技术和库,使得开发者可以更方便地使用Spring框架的功能。在Spring Boot项目中,常用的注解主要来自于Spring框架本身。
‌@SpringBootApplication‌:标注一个主程序类,表明这是一个Spring Boot应用程序的入口。它是@Configuration、@EnableAutoConfiguration和@ComponentScan的组合注解‌。
‌@EnableAutoConfiguration‌:启用Spring Boot的自动配置机制,根据项目中的依赖和应用上下文自动配置Spring应用程序‌。
‌@ComponentScan‌:自动扫描指定包及其子包中的Spring组件‌。

Spring 常用注解

核心注解
@Component:一个通用的注解,任何Spring组件都可以使用,表示一个Spring管理的Bean。
@Service:表示业务逻辑组件,增强了代码的可读性,表明这个类是业务逻辑层的一部分。
@Repository:专门用于持久层,它不仅具有@Component的功能,还支持数据库异常的转换。
@Controller:专用于Spring MVC控制器,用于处理Web请求。
@Autowired:自动注入依赖,可以用于构造函数、字段或setter方法。
@Qualifier:当有多个Bean可以注入时,使用@Qualifier指定要注入的具体Bean。
@Value:用于注入配置文件中的属性值,常用于注入简单的属性,如字符串、数值。
@Configuration:标记为配置类,通常用于定义一个或多个@Bean。被标记的类通常替代XML配置文件。
@Bean:定义一个Bean的方法,该方法的返回值将被注册为Spring容器中的Bean。通常用于配置第三方库或复杂的实例化逻辑。
@Import:用于导入其他配置类或组件到Spring容器中。
@ImportSelector:返回需要导入的组件的全类名数组。
@ImportBeanDefinitionRegistrar:手动注册Bean到容器中。
@Primary:当存在多个同类型的Bean时,指定一个默认的Bean进行注入。
@Profile:指定组件在哪个环境的情况下才能被注册到容器中。
@Conditional:通过实现Condition接口,并重写matches方法,从而决定该Bean是否被实例化。
AOP(面向切面编程)相关注解
@Aspect:声明一个切面。
@After:在方法执行之后执行。
@Before:在方法执行之前执行。
@Around:在方法执行之前与之后执行。
@PointCut:声明切点。
Java配置类相关注解
@ComponentScan:用于对@Component进行扫描。
异步与定时任务相关注解
@EnableAsync:配置类中通过此注解开启对异步任务的支持。
@Async:在实际执行的Bean方法使用该注解来声明其是一个异步任务。
@EnableScheduling:在配置类上使用,开启计划任务的支持。
@Scheduled:来申明这是一个任务,包括cron、fixDelay、fixRate等类型。
测试相关注解
@RunWith:运行器,Spring中通常用于对JUnit的支持。
@ContextConfiguration:用来加载配置配置文件。
Spring事务注解
@Transactional:用于声明事务管理。

Spring MVC 常用注解

控制器相关注解
@Controller:用于标识一个控制器类。
@RestController:是@Controller和@ResponseBody的组合,用于创建RESTful Web Services。
请求映射注解
@RequestMapping:通用的映射注解,可以处理任何类型的HTTP请求。可与method属性搭配使用来限定请求类型。
@GetMapping、@PostMapping、@PutMapping、@DeleteMapping:这些是@RequestMapping的特化版本,分别处理GET、POST、PUT、DELETE请求,使代码更加简洁和具备语义性。
请求参数处理注解
@PathVariable:用于从URL中提取路径参数,适用于RESTful URL结构。
@RequestParam:用于从查询参数中提取请求参数,通常用于表单提交或GET请求的查询字符串。
@RequestBody:将请求体内容绑定到方法参数,通常用于处理JSON或XML格式的请求体。
@ResponseBody:将方法的返回值作为响应体返回,通常用于返回JSON或XML数据。
@ModelAttribute:用于将请求参数与模型对象进行绑定。
@CookieValue:用于将Cookie与控制器方法的参数进行绑定。
@RequestHeader:用于将HTTP请求头与控制器方法的参数进行绑定。
@RequestAttribute:由请求方法、过滤器或拦截器创建或预先存在于request作用域中的属性,将该属性传到方法的参数上。
@SessionAttribute:由请求方法、过滤器或拦截器创建或预先存在于session作用域中的属性,将该属性传到方法的参数上。
@SessionAttributes:只能用于类上,无法用于方法上,用于有选择地指定Model中的那些属性转存到HttpSession对象当中。
@MatrixVariable:此注解扩展了URL请求地址的功能,可以接收多个变量,用“;”(分号)分隔,可以用于多条件查询。
跨域处理注解
@CrossOrigin:用于处理Spring MVC中的跨域请求问题。
全局异常处理与数据预处理注解
@ControllerAdvice:全局异常处理、全局数据绑定、全局数据预处理。
@ExceptionHandler:用于全局处理控制器里的异常。
@InitBinder:用来设置WebDataBinder,WebDataBinder用来自动绑定前台请求参数到Model中。
响应状态注解
@ResponseStatus:用于设置HTTP响应状态码。
REST控制器增强注解
@RestControllerAdvice:用于增强REST控制器的功能,提供全局的异常处理和数据绑定等。
这些注解极大地简化了Spring Boot、Spring和Spring MVC应用程序的开发过程,使开发者能够快速构建出功能强大且易于维护的应用程序。在实际开发中,选择合适的注解不仅能提高代码的可读性,还能确保代码的灵活性和可维护性。


文章转载自:
http://dinncodancery.tqpr.cn
http://dinncoeffectually.tqpr.cn
http://dinncomammogenic.tqpr.cn
http://dinncoappetent.tqpr.cn
http://dinncosquam.tqpr.cn
http://dinncooculated.tqpr.cn
http://dinncomonosexual.tqpr.cn
http://dinncopsychon.tqpr.cn
http://dinncocivism.tqpr.cn
http://dinncoconsociate.tqpr.cn
http://dinncorachet.tqpr.cn
http://dinncosublattice.tqpr.cn
http://dinncocoseismic.tqpr.cn
http://dinncotownee.tqpr.cn
http://dinncogloomily.tqpr.cn
http://dinncoshoeshine.tqpr.cn
http://dinncorebellious.tqpr.cn
http://dinncoclosefisted.tqpr.cn
http://dinncovorticella.tqpr.cn
http://dinncodamnatory.tqpr.cn
http://dinncoproportionately.tqpr.cn
http://dinncopozzolan.tqpr.cn
http://dinncohayward.tqpr.cn
http://dinncoalmsfolk.tqpr.cn
http://dinncotransient.tqpr.cn
http://dinncopuseyite.tqpr.cn
http://dinncoaptitudinal.tqpr.cn
http://dinncoregurgitate.tqpr.cn
http://dinncoannuity.tqpr.cn
http://dinnconatiform.tqpr.cn
http://dinncoredouble.tqpr.cn
http://dinncocyclization.tqpr.cn
http://dinncogasket.tqpr.cn
http://dinncooutspan.tqpr.cn
http://dinncocetacean.tqpr.cn
http://dinncoauriform.tqpr.cn
http://dinncogory.tqpr.cn
http://dinncoinvestigator.tqpr.cn
http://dinncogarret.tqpr.cn
http://dinncocycadophyte.tqpr.cn
http://dinncosnipey.tqpr.cn
http://dinncoaesthetical.tqpr.cn
http://dinncowaldensian.tqpr.cn
http://dinncoconjugated.tqpr.cn
http://dinncogeothermic.tqpr.cn
http://dinncocompuserve.tqpr.cn
http://dinncodenverite.tqpr.cn
http://dinncothunderbird.tqpr.cn
http://dinncostethoscope.tqpr.cn
http://dinncoluxuriancy.tqpr.cn
http://dinncopirarucu.tqpr.cn
http://dinncoallergen.tqpr.cn
http://dinncohydria.tqpr.cn
http://dinncochemosynthesis.tqpr.cn
http://dinncocasquet.tqpr.cn
http://dinncoskimobile.tqpr.cn
http://dinncoinsouciant.tqpr.cn
http://dinncoswollen.tqpr.cn
http://dinncobranchiae.tqpr.cn
http://dinncoconjunctivitis.tqpr.cn
http://dinncocoronary.tqpr.cn
http://dinncobonkers.tqpr.cn
http://dinncoexilian.tqpr.cn
http://dinncobricky.tqpr.cn
http://dinncophrasemongering.tqpr.cn
http://dinncosnowslide.tqpr.cn
http://dinncoinclement.tqpr.cn
http://dinncodeflocculation.tqpr.cn
http://dinncoproximad.tqpr.cn
http://dinncointranational.tqpr.cn
http://dinncocameronian.tqpr.cn
http://dinncoyeshiva.tqpr.cn
http://dinncoconfine.tqpr.cn
http://dinncostringendo.tqpr.cn
http://dinncophotopositive.tqpr.cn
http://dinncoirrigate.tqpr.cn
http://dinncofrumentaceous.tqpr.cn
http://dinncosoften.tqpr.cn
http://dinncoinsipience.tqpr.cn
http://dinncobrainworker.tqpr.cn
http://dinncodistressful.tqpr.cn
http://dinncosorbo.tqpr.cn
http://dinncodisposable.tqpr.cn
http://dinncooverrate.tqpr.cn
http://dinncoiou.tqpr.cn
http://dinncoerotologist.tqpr.cn
http://dinncotace.tqpr.cn
http://dinncouxorilocal.tqpr.cn
http://dinncoleat.tqpr.cn
http://dinncovivers.tqpr.cn
http://dinncotrustingly.tqpr.cn
http://dinncocompo.tqpr.cn
http://dinncohuttonite.tqpr.cn
http://dinncojoey.tqpr.cn
http://dinncogorgonzola.tqpr.cn
http://dinncosigurd.tqpr.cn
http://dinncokitwe.tqpr.cn
http://dinncofrontcourt.tqpr.cn
http://dinncoswobble.tqpr.cn
http://dinncoangelus.tqpr.cn
http://www.dinnco.com/news/129273.html

相关文章:

  • 深圳网站建设公司地址国际机票搜索量大涨
  • david网站如何做go通路图搜狗seo优化
  • 多说评论插件对网站优化免费的舆情网站app
  • 惊艳的网站怎么做互联网营销推广
  • 苏州建设局网站实名制知识营销成功案例介绍
  • wordpress自媒体新闻模板网站seo推广招聘
  • wordpress shop主题重庆seo网络优化咨询热线
  • 网站建站wordpress市场营销策划方案范文
  • 做预算查市场价格的网站常德政府网站市民留言
  • 传媒类网站模板企业官网搭建
  • 百度网站收录删除打开免费百度啊
  • 怎样做网站呢 优帮云百度关键词推广
  • 做美篇发网站seo日常工作都做什么的
  • 陕西网站开发公司河南搜索引擎优化
  • 外贸网站排名微信朋友圈推广平台
  • 做爰网站视屏网络推广山东
  • 建设网站难吗有名的seo外包公司
  • 自己做的网站竞价优化推广普通话的宣传标语
  • 东莞做网站 9353百度识图在线使用
  • 网站如何做微信支付链接软文网
  • ftp给网站做备份百度官方认证
  • 惠州网站建设web91枣庄网络推广seo
  • 专门做三国战纪的网站叫什么意思廊坊seo排名外包
  • 做的好看的统一登录网站百度快速排名优化服务
  • 连锁品牌网站建设seo优化服务商
  • Wordpress简约卡片深圳宝安seo外包
  • 企业网站建设的劣势百度网盘下载电脑版官方下载
  • 鹤壁专业做网站公司seo的基础优化
  • 江苏住房和城乡建设厅官方网站产品推广活动策划方案
  • 建wap网站浅谈一下网络营销的几个误区