赞
踩
org.springframework.boot
spring-boot-starter-freemarker
org.springframework.boot
true
org.springframework.boot
true
3、创建SpringBoot启动程序
注意:springBoot必须放在Controller包的顶层
package com.jmxk;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class SpringBoot_Start {
public static void main(String[] args) {
SpringApplication.run(SpringBoot_Start.class, args);
}
}
4、创建HTTP请求连接类
package com.jmxk.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
//@RestController = @Conctroller + @ResponseBody
@RestController
public class HelloController {
@RequestMapping(“/helloIndex”)
public String HelloIndex() {
return “欢迎使用springBoot2.0!”;
}
}
5、启动SpringBoot程序
控制信息出现Spring图标样式并且程序一直在运行没报错则表示启动成功!
. ____ _ __ _ _
/\ / _’ __ _ () __ __ _ \ \ \ \
( ( )___ | '_ | '| | ’ / _` | \ \ \ \
\/ _)| |)| | | | | || (| | ) ) ) )
’ || .__|| ||| |__, | / / / /
=|_|======|/=////
:: Spring Boot :: (v2.1.1.RELEASE)
2019-08-15 11:25:58.306 INFO 15224 — [ restartedMain] com.jmxk.SpringBoot_Start : Starting SpringBoot_Start on DESKTOP-A9VMB8N with PID 15224 (F:\Eclipse-WorkSpace\JavaEE\SpringBoot_Start\target\classes started by com in F:\Eclipse-WorkSpace\JavaEE\SpringBoot_Start)
2019-08-15 11:25:58.309 INFO 15224 — [ restartedMain] com.jmxk.SpringBoot_Start : No active profile set, falling back to default profiles: default
2019-08-15 11:25:58.357 INFO 15224 — [ restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : Devtools property defaults active! Set ‘spring.devtools.add-properties’ to ‘false’ to disable
2019-08-15 11:25:58.357 INFO 15224 — [ restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : For additional web related logging consider setting the ‘logging.level.web’ property to ‘DEBUG’
2019-08-15 11:25:59.419 INFO 15224 — [ restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http)
2019-08-15 11:25:59.441 INFO 15224 — [ restartedMain] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2019-08-15 11:25:59.441 INFO 15224 — [ restartedMain] org.apache.catalina.core.StandardEngine : Starting Servlet Engine: Apache Tomcat/9.0.13
2019-08-15 11:25:59.449 INFO 15224 — [ restartedMain] o.a.catalina.core.AprLifecycleListener : The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [C:\Program Files\Java\jdk1.8\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:/Program Files/Java/jdk1.8/bin/…/jre/bin/server;C:/Program Files/Java/jdk1.8/bin/…/jre/bin;C:/Program Files/Java/jdk1.8/bin/…/jre/lib/amd64;C:\Python27;C:\Python27\Scripts;C:\Python\Python37\Scripts;C:\Python\Python37;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\Program Files\Java\jdk1.8\bin;MYSQL_HOME%\bin;D:\Maven\apache-maven-3.6.0\bin;D:\Node\nodejs;C:\ProgramData\chocolatey\bin;C:\Program Files\TortoiseGit\bin;C:\WINDOWS\System32\OpenSSH;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\TXsoft\Git\cmd;C:\Users\com\AppData\Local\Microsoft\WindowsApps;D:\Node\nodejs\node_global;;D:\JetBrains\IntelliJ IDEA 2019.1\bin;;D:\JetBrains\WebStorm 2019.1\bin;;C:\WINDOWS\system32;;.]
2019-08-15 11:25:59.522 INFO 15224 — [ restartedMain] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2019-08-15 11:25:59.523 INFO 15224 — [ restartedMain] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 1165 ms
2019-08-15 11:25:59.725 INFO 15224 — [ restartedMain] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService ‘applicationTaskExecutor’
2019-08-15 11:25:59.806 INFO 15224 — [ restartedMain] o.s.b.a.w.s.WelcomePageHandlerMapping : Adding welcome page template: index
2019-08-15 11:25:59.905 INFO 15224 — [ restartedMain] o.s.b.d.a.OptionalLiveReloadServer : LiveReload server is running on port 35729
2019-08-15 11:25:59.954 INFO 15224 — [ restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8080 (http) with context path ‘’
2019-08-15 11:25:59.958 INFO 15224 — [ restartedMain] com.jmxk.SpringBoot_Start : Started SpringBoot_Start in 1.936 seconds (JVM running for 3.838)
springboot不需要输入项目名称,输入格式是本地IP地址+端口号+请求路径
本地IP地址:localhost或者127.0.0.1
端口号默认:8080
请求路径为Controller类中注解@RequestMapping(“/helloIndex”)自定义的值
org.springframework.boot
spring-boot-starter-freemarker
Spring整合FreeMarker!
${map.id}
${map.name}
${map.sex}
${map.age}
自我介绍一下,小编13年上海交大毕业,曾经在小公司待过,也去过华为、OPPO等大厂,18年进入阿里一直到现在。
深知大多数Java工程师,想要提升技能,往往是自己摸索成长或者是报班学习,但对于培训机构动则几千的学费,着实压力不小。自己不成体系的自学效果低效又漫长,而且极易碰到天花板技术停滞不前!
因此收集整理了一份《2024年Java开发全套学习资料》,初衷也很简单,就是希望能够帮助到想自学提升又不知道该从何学起的朋友,同时减轻大家的负担。
既有适合小白学习的零基础资料,也有适合3年以上经验的小伙伴深入学习提升的进阶课程,基本涵盖了95%以上Java开发知识点,真正体系化!
由于文件比较大,这里只是将部分目录截图出来,每个节点里面都包含大厂面经、学习笔记、源码讲义、实战项目、讲解视频,并且会持续更新!
如果你觉得这些内容对你有帮助,可以扫码获取!!(备注Java获取)
为了这次面试,也收集了很多的面试题!
以下是部分面试题截图
《互联网大厂面试真题解析、进阶开发核心学习笔记、全套讲解视频、实战项目源码讲义》点击传送门即可获取!
s://img-community.csdnimg.cn/images/e5c14a7895254671a72faed303032d36.jpg" alt=“img” style=“zoom: 33%;” />
为了这次面试,也收集了很多的面试题!
以下是部分面试题截图
[外链图片转存中…(img-AlnnBSlf-1713082558684)]
《互联网大厂面试真题解析、进阶开发核心学习笔记、全套讲解视频、实战项目源码讲义》点击传送门即可获取!
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。