springboot默認(rèn)提供thymeleaf的模板,對(duì)于從傳統(tǒng)web開(kāi)發(fā)轉(zhuǎn)過(guò)來(lái)的人來(lái)說(shuō),不喜歡! 然而 spring boot并沒(méi)有給我們初始化webapp目錄。所以,還是手動(dòng)吧。
4.0.0com.lghsample0.0.1-SNAPSHOTwarsampleDemo project for Spring Bootorg.springframework.bootspring-boot-starter-parent2.0.2.RELEASEUTF-8UTF-81.8org.springframework.bootspring-boot-starter-webjavax.servletjstlorg.springframework.bootspring-boot-starter-tomcatorg.apache.tomcat.embedtomcat-embed-jasperorg.springframework.bootspring-boot-starter-testtestorg.springframework.bootspring-boot-devtoolsruntimeorg.springframework.bootspring-boot-maven-pluginorg.apache.maven.pluginsmaven-surefire-pluginfalse
4.0.0com.lghclient0.0.1-SNAPSHOTwarclientDemo project for Spring Bootorg.springframework.bootspring-boot-starter-parent2.0.2.RELEASEUTF-8UTF-81.8org.springframework.bootspring-boot-starter-weborg.springframework.bootspring-boot-starter-tomcatjavax.servletjstljavax.servletjavax.servlet-api3.1.0providedorg.springframework.bootspring-boot-starter-testtestorg.springframework.bootspring-boot-devtoolsruntimeorg.springframework.bootspring-boot-maven-plugintrueorg.apache.maven.pluginsmaven-surefire-pluginfalsemaven-compiler-plugin1.81.8
4.0.0com.lghsample0.0.1-SNAPSHOTwarsampleDemo project for Spring Bootorg.springframework.bootspring-boot-starter-parent2.0.2.RELEASEUTF-8UTF-81.8org.springframework.bootspring-boot-starter-weborg.springframework.bootspring-boot-devtoolsruntimeorg.springframework.bootspring-boot-starter-tomcatprovidedorg.springframework.bootspring-boot-starter-testtestorg.springframework.bootspring-boot-maven-plugin
此時(shí)執(zhí)行main方法啟動(dòng)應(yīng)用,報(bào)錯(cuò)如下 org.springframework.beans.factory.BeanDefinitionStoreException: Failed to parse configuration class [com.lgh.client.ClientApplication]; nested exception is java.lang.IllegalStateException: Failed to introspect annotated methods on class org.springframework.boot.web.servlet.support.SpringBootServletInitializer
摘要:如下頁(yè)面模版的配置啟動(dòng)簡(jiǎn)單流程當(dāng)我們運(yùn)行的方法時(shí)調(diào)用靜態(tài)方法首先是實(shí)例化初始化的時(shí)候主要做主要做三件事根據(jù)下是否存在判斷是否要啟動(dòng)一個(gè)。將配置環(huán)境加入到監(jiān)聽(tīng)器對(duì)象中。方法將等重要組件與上下文對(duì)象關(guān)聯(lián)。自此的簡(jiǎn)單流程到此結(jié)束。
正文
說(shuō)springboot的啟動(dòng)流程當(dāng)然少不了springboot啟動(dòng)入口類
@SpringBootApplication
public class Sprin...