美文网首页
project 1 -automatic system-Spri

project 1 -automatic system-Spri

作者: gyDBD | 来源:发表于2018-04-21 09:19 被阅读0次

Spring Boot 

The problem with Spring and Spring MVC is the amount of configuration that is needed. Spring Boot solves this problem through a combination of Auto Configuration and Starter Projects. 

Spring Boot looks at a) Frameworks available on the CLASSPATH b) Existing configuration for the application. Based on these, Spring Boot provides basic configuration needed to configure the application with these frameworks. This is called Auto Configuration.

Spring Boot Start Projects?

Starters are a set of convenient dependency descriptors that you can include in your application.

 Explain more about Starters with an example?

Spring Boot Start Web.

If you want to develop a web application or an application to expose restful services, Spring Boot Start Web is the starter to pick. Lets create a quick project with Spring Boot Starter Web using Spring Initializr.

Dependency for Spring Boot Starter Web

<dependency>

    <groupId>org.springframework.boot<groupId>

    <artifactId>spring-boot-starter-web<artifactId>

</dependency>

Any typical web application would use all these dependencies. Spring Boot Starter Web comes pre packaged with these.

What are the other Starter Project Options that Spring Boot provides?

spring-boot-starter-web-services - SOAP Web Services

spring-boot-starter-web - Web & RESTful applications

spring-boot-starter-test - Unit testing and Integration Testing

spring-boot-starter-jdbc - Traditional JDBC

What is the easiest approach to create a Spring Boot Project?

Spring Initializr http://start.spring.io/ is great tool to bootstrap your Spring Boot projects.

 Is Spring Initializr the only way to create Spring Boot Projects?

No.

Spring Initializr makes it easy to create Spring Boot Projects. But you can setup a maven project and add the right dependencies to start off.

Here are the important steps:

In Eclipse, Use File -> New Maven Project to create a new project.

Add dependencies.

Add the maven plugins!

Add the Spring Boot Application class

What and Why Embedded Servers?

This idea is the genesis for Embedded Servers.

When we create an application deployable, we would embed the server (for example, tomcat) inside the deployable.For example, for a Spring Boot Application, you can generate an application jar which contains Embedded Tomcat. You can run a web application as a normal Java application!

What is the need for Profiles?

Enterprise application development is complex. You have multiple environments

Dev

QA

Stage

Production

You want to have different application configuration in each of the environments.

Profiles help to have different application configuration for different environments.

Q : How can you use profiles to configure environment specific configuration with Spring Boot?

Profile is nothing but a key to identify an environment.

In this example, we will use two profiles

dev

prod

The default application configuration is present in application.properties. Let’s consider an example.

application.properties:

basic.value= true

basic.message= Dynamic Message

basic.number= 100

相关文章

  • project 1 -automatic system-Spri

    Spring Boot The problem with Spring and Spring MVC is the...

  • 热部署

    1、File–Settings–Compiler-- --> 勾选 build project automatic...

  • Automatic Rejection 1

    正如批判性思维者,我们需要某个合理的原则来接受或拒绝包括挑战我们观点的任何言论或要求。构建这个原则的唯一路径就是评...

  • Automatic rejection 1

    作为批判性思考者,我们需要一个接受或者拒绝任何论证或者声称,包括对我们观点质疑的合理的基础。确立这种基础的...

  • Automatic Rejection 1

    作为批判性思考者,我们需要一个合理的基础为接受或者拒绝任何争论或辩解,甚至包括对我们思想的挑战。建立这种基础的唯一...

  • Automatic Rejection1

    作为批判性思考者,我们需要一个合理的基础来接受或拒绝任何争论或要求,包括对我们的想法的挑战。建立这个基础的唯一方法...

  • Project 1

    Problem: subrecipe cause lot abort

  • 1 Project Overview 1.1 Project

    1.项目介绍 在本项目中,我们实现了对人脸图片数据的三种处理:人脸互换(face swap)、人脸融合(face ...

  • 深度学习笔记(四)—— 前馈神经网络的 PyTorch 实现

    1 AUTOGRAD AUTOMATIC DIFFERENTIATION Central to all neura...

  • 016 Hadoop NameNode 自动故障切换

    016 Hadoop NameNode Automatic Failover 1. Objective 1. 目标...

网友评论

      本文标题:project 1 -automatic system-Spri

      本文链接:https://www.haomeiwen.com/subject/svvtlftx.html