Spring Boot Web Executable Demo
Spring Boot Web Executable Demo
*/-->
pre.src {background-color: #292b2e; color: #b2b2b2;}
pre.src {background-color: #292b2e; color: #b2b2b2;}
pre.src {background-color: #292b2e; color: #b2b2b2;}
pre.src {background-color: #292b2e; color: #b2b2b2;}
pre.src {background-color: #292b2e; color: #b2b2b2;}
pre.src {background-color: #292b2e; color: #b2b2b2;}
pre.src {background-color: #292b2e; color: #b2b2b2;}
pre.src {background-color: #292b2e; color: #b2b2b2;}
pre.src {background-color: #292b2e; color: #b2b2b2;}
pre.src {background-color: #292b2e; color: #b2b2b2;}
pre.src {background-color: #292b2e; color: #b2b2b2;}
pre.src {background-color: #292b2e; color: #b2b2b2;}
pre.src {background-color: #fbf8ef; color: #655370;}
pre.src {background-color: #fbf8ef; color: #655370;}
pre.src {background-color: #fbf8ef; color: #655370;}
pre.src {background-color: #fbf8ef; color: #655370;}
pre.src {background-color: #fbf8ef; color: #655370;}
pre.src {background-color: #292b2e; color: #b2b2b2;}
pre.src {background-color: #292b2e; color: #b2b2b2;}
pre.src {background-color: #292b2e; color: #b2b2b2;}
pre.src {background-color: #292b2e; color: #b2b2b2;}
pre.src {background-color: #292b2e; color: #b2b2b2;}
Spring Boot Web Executable Demo
Table of Contents
1 Step by Step
- 新建intellij project maven 项目
- 加入pom依赖
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.3.5.RELEASE</version>
</parent> <dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
</dependencies>
- 新建入口类
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody; /**
* Created by csophys on 16/8/31.
*/
@Controller
@EnableAutoConfiguration
public class ExecutorController { @RequestMapping("/")
@ResponseBody
public String hello(){
return "hello world";
} public static void main(String[] args) {
SpringApplication.run(ExecutorController.class,args);
}
}
- 静态资源处理
resources下新建static 目录,static目录下新建index.html 文件可以默认访问到
- 启动入口类,浏览器访问成功
- 生成可执行的jar
1. 修改xml
加入
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
2. 执行jar
java -jar /Users/csophys/code/downloadVoiceFileWithConnid/target/csophys-1.0-SNAPSHOT.jar
Spring Boot Web Executable Demo的更多相关文章
- Springboot 系列(六)Spring Boot web 开发之拦截器和三大组件
1. 拦截器 Springboot 中的 Interceptor 拦截器也就是 mvc 中的拦截器,只是省去了 xml 配置部分.并没有本质的不同,都是通过实现 HandlerInterceptor ...
- Springboot 系列(七)Spring Boot web 开发之异常错误处理机制剖析
前言 相信大家在刚开始体验 Springboot 的时候一定会经常碰到这个页面,也就是访问一个不存在的页面的默认返回页面. 如果是其他客户端请求,如接口测试工具,会默认返回JSON数据. { &quo ...
- Springboot 系列(五)Spring Boot web 开发之静态资源和模版引擎
前言 Spring Boot 天生的适合 web 应用开发,它可以快速的嵌入 Tomcat, Jetty 或 Netty 用于包含一个 HTTP 服务器.且开发十分简单,只需要引入 web 开发所需的 ...
- Spring Boot Web应用开发 CORS 跨域请求支持:
Spring Boot Web应用开发 CORS 跨域请求支持: 一.Web开发经常会遇到跨域问题,解决方案有:jsonp,iframe,CORS等等CORS与JSONP相比 1. JSONP只能实现 ...
- 转-spring boot web相关配置
spring boot web相关配置 80436 spring boot集成了servlet容器,当我们在pom文件中增加spring-boot-starter-web的maven依赖时,不做任何w ...
- PART 5: INTEGRATING SPRING SECURITY WITH SPRING BOOT WEB
转自:http://justinrodenbostel.com/2014/05/30/part-5-integrating-spring-security-with-spring-boot-web/ ...
- Spring Boot 1 创建Demo
Spring Boot的主要优点: 为所有Spring开发者更快的入门 开箱即用,提供各种默认配置来简化项目配置 内嵌式容器简化Web项目 没有冗余代码生成和XML配置的要求 入门操作: 1.打开ht ...
- spring boot 登录注册 demo (四) -- 体验小结
之前没有折腾过Spring,直接上来怼Spring Boot异常痛苦,参考着官网的guide(https://spring.io/guides)写了几个demo: spring boot 跑起来确是方 ...
- spring boot 登录注册 demo (一)
Welcome to Spring Boot 代码结构 src/main/java 下 controller层,路由功能dao层,数据库的访问domain,bean的存放service,业务层appl ...
随机推荐
- ActiveXObject函数详解(转)
什么是 ActiveX 控件? ActiveX 控件广泛用于 Internet.它们可以通过提供视频.动画内容等来增加浏览的乐趣.不过,这些程序可能出问题或者向您提供不需要的内容.在某些情况下,这些程 ...
- PopupWindow组件的使用问题
//如果默认屏幕的话,父view就写自己 popupWindow.showAtLocation(inflate, Gravity.BOTTOM, 0, 0); PopupWindow 顾名思义为弹出式 ...
- How do JavaScript closures work?
Like the old Albert Einstein said: If you can't explain it to a six-year-old, you really don't under ...
- 加工生产调度(prod)
加工生产调度(prod) 题目描述 有n个部件需在A.B机器上加工,每个工件都必须经过先A后B两道工序. 已知:部件i在A.B机器上的加工时间分别为ai,bi. 问:如何安排n个工件的加工顺序,才能使 ...
- angula组件-通过键盘实现多选(原创)
在刚刚结束的angular交易系统项目中有几个需求是让我感觉要花点时间的 如何更优雅的使用angular-bootstrap 的 Modal框. 通过键盘实现ctrl多选,shfit批量选的功能. 如 ...
- DataGridView如何实现列标头带数据筛选功能,就象Excel高级筛选功能一样
'近日有本论坛网友问:DataGridView如何实现列标头带数据筛选功能,就象Excel高级筛选功能一样 '今晚正好闲着没事,加之以前也没用到过这个需求,所以就写了个模拟功能,供各位坛友酌情参考. ...
- CSS中绝对定位依据谁进行定位?
结论 绝对定位的top等的依据元素需满足3个条件: 已定位(position:relative/fixed/absolute) 最近的 祖辈元素(一定是祖辈元素不是同辈元素) 说明 一般会为body设 ...
- 让你的MyEclipse具有jquery自动提示
想让你的MyEclipse支持Jquery的自动提示更简单一些,照下图完成即可: 照上面图示已经完成了Jquery自动提示的配置,此时spket已经有两种AJAX库的自动提示,通过右边的De ...
- HDU 5166 Missing number 简单数论
Missing number Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) [ ...
- git查看每个版本间的差异
命令行: 1,git log: 2,git diff 版本号码 窗口类型: 1,sudo apt-get install gitk 2,gitk