零配置使用springboot
1、pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion> <groupId>com.daixinet</groupId>
<artifactId>test</artifactId>
<version>1.0</version>
<packaging>war</packaging> <parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.4.2.RELEASE</version>
</parent> <dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope>
</dependency>
</dependencies> </project>
2、Application
package com.daixinet; import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.support.SpringBootServletInitializer; @SpringBootApplication
public class Application extends SpringBootServletInitializer { @Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
return application.sources(Application.class);
} public static void main(String[] args) throws Exception {
SpringApplication.run(Application.class, args);
}
}
3、实例:src
零配置使用springboot的更多相关文章
- 菜鸟学Struts2——零配置(Convention )
又是周末,继续Struts2的学习,之前学习了,Struts的原理,Actions以及Results,今天对对Struts的Convention Plugin进行学习,如下图: Struts Conv ...
- 13、零配置Struts2开发
Convention 插件 从 Struts 2.1 开始, Struts 可以使用 Convention 插件来支持零配置: Convention 插件完全抛弃配置信息, 不仅不需要使用 strut ...
- [原创]Centos7 从零配置Nginx+PHP+MySql
序言 这次玩次狠得.除了编译器使用yum安装,其他全部手动编译.哼~ 看似就Nginx.PHP.MySql三个东东,但是它们太尼玛依赖别人了. 没办法,想用它们就得老老实实给它们提供想要的东西. 首先 ...
- SpringMVC4零配置--web.xml
servlet3.0+规范后,允许servlet,filter,listener不必声明在web.xml中,而是以硬编码的方式存在,实现容器的零配置. ServletContainerInitiali ...
- 一个简单的零配置命令行HTTP服务器
http-server 是一个简单的零配置命令行HTTP服务器, 基于 nodeJs. 如果你不想重复的写 nodeJs 的 web-server.js, 则可以使用这个. 安装 (全局安装加 -g) ...
- Struts2零配置介绍(约定访问)
从struts2.1开始,struts2 引入了Convention插件来支持零配置,使用约定无需struts.xml或者Annotation配置 需要 如下四个JAR包 插件会自动搜索如下类 act ...
- 一个简单的零配置命令行HTTP服务器 - http-server (nodeJs)
http-server 是一个简单的零配置命令行HTTP服务器, 基于 nodeJs. 如果你不想重复的写 nodeJs 的 web-server.js, 则可以使用这个. 安装 (全局安装加 -g) ...
- SpringMVC4零配置--Web上下文配置【MvcConfig】
与SpringSecurity的配置类似,spring同样为我们提供了一个实现类WebMvcConfigurationSupport和一个注解@EnableWebMvc以帮助我们减少bean的声明. ...
- struts2 零配置
一.新建一个web项目,命名为:struts2 二.导入strut2所需的jar包 所需jar下载:http://pan.baidu.com/s/1dDxP4Z3 三.配置struts2的启动文件,在 ...
随机推荐
- Excel连接SSAS提示“传输层中遇到错误”的问题
用Excel连接SSAS,在身份验证时弹出对话框提示“传输层中遇到错误”,后来发现其实就是用户名或密码不对,不知道为何Excel不提示一个明确一点的信息.
- CentOS6 配置静态IP
1.首先配置网络连接方式 VMware选择编辑->虚拟网络编辑器->VMnet0桥接模式 2.配置网卡 vim /etc/sysconfig/network-scripts/ifcfg-e ...
- timeStamp(时间戳) 事件属性
Event 对象 定义和用法 timeStamp 事件属性可返回一个时间戳.指示发生事件的日期和时间(从 epoch 开始的毫秒数). epoch 是一个事件参考点.在这里,它是客户机启动的时间. 并 ...
- absolute之后居中宽度自适应
position:absolute;之后居中宽度自适应,不用再设定宽度了 css代码如下: .promptBox{display:none;border:1px solid #ccc;paddin ...
- 方法 - ShellCode测试
机器码->汇编 1 // ShellCode测试.cpp : 定义控制台应用程序的入口点. // #include "stdafx.h" #include <windo ...
- [UE4]正交
一.如果两条直线是垂直的,那么就可以说这2条直线是正交的.既然有垂直,为什么还要有正交概念呢? 因为正交可以描述两个或者多个变量之间互不影响.互不干涉,而垂直是完全属于几何的术语. 二.具有正交关系的 ...
- SCCM 2012 R2实战系列之八:OSD(上)--分发全新Windows7系统
今天将跟大家一起分享SCCM 中最为重要的一个功能---操作系统分发(OSD),在此文章中会讨论到OSD的初始化配置.镜像的导入.任务序列的创建编辑.并解决大家经常遇到的分发windows7系统分区盘 ...
- C# 线程 在 sleep,suspend 之后 Abort 的方法
1) 线程在sleep时的Abort 方法:对线程函数用 catch ThreadAbortException ,并return. 示例: [csharp] view plaincopy ...
- boost json序列化
json序列化 #ifndef FND_JSON_OBJECT_H #define FND_JSON_OBJECT_H #include <sstream> #include <bo ...
- FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. com/mongodb/util/JSON
问题: 将MongoDB数据导入Hive,按照https://blog.csdn.net/thriving_fcl/article/details/51471248文章,在hive建外部表与mongo ...