当前位置: 首页 > news >正文

项目集成springboot【JWordpres前台项目实战】

写在前面

本篇文章主要介绍如何新建一个springboot应用,以及如何启动和配置server信息。跟随本文可以快速让新手创建一个springboot应用

代码

整体项目结构

父工程JWordpress的pom.xml主要代码

<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.4.2.RELEASE</version>
<relativePath/> <!– lookup parent from repository –>
</parent>

子工程jworpdress-web的pom.xml

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
</exclusion>
</exclusions>
</dependency>

应用启动类

/**
* MIT License
* Copyright (c) 2018 haihua.liu
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the “Software”), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package cn.liuhaihua.web;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.transaction.annotation.EnableTransactionManagement;

import cn.liuhaihua.web.mapper.BaseMapper;

/**
* @ClassName: JWordpressWebApplication
* @Description: Springboot应用程序启动类
* @author Liuhaihua
* @date 2018年6月26日
*
*/
@SpringBootApplication
@EnableTransactionManagement
@MapperScan(basePackages = “cn.liuhaihua.web.*”, markerInterface = BaseMapper.class)
public class JWordpressWebApplication {

/**
* @Title: main
* @Description: main启动方法
* @param @param args
* @return void
* @throws
*/
public static void main(String[] args) {
SpringApplication.run(JWordpressWebApplication.class, args);
System.out.println(“JWordpressWebApplication启动成功”);
}

}

配置文件如下,主要配置服务端口和tomat最大最小线程数

###################server##################
server.context-path=
server.port=8090
server.tomcat.max-threads=500
server.tomcat.min-spare-threads=20

最后启动效果

源代码仓库:gitee.com/jxuasea/JWo…



相关文章:

  • Sublime Text3 配置
  • ALTER SYSTEM ARCHIVELOG CURRENT挂起案例
  • Mblog 部署手册
  • iOS组件化(一):创建本地私有库
  • linux top 命令
  • HeyUI组件库发布vscode插件,PS教程: 如何开发vscode插件?
  • thinkphp3.2.3 定时任务重新加载, 无法加载新的定时任务的问题
  • PHP中使用Elasticsearch
  • WebView性能、体验分析与优化
  • MDT2013批量升级Win7客户端至Win10
  • 第22章,mysql数据库-1
  • Python_week1-2018.7.8(购物车,BMI增删改查系统)
  • 服务器状态监控相关
  • 初学Python——面向对象编程
  • 给妹子讲python-S01E07字符编码历史观-从ASCII到Unicode
  • [分享]iOS开发 - 实现UITableView Plain SectionView和table不停留一起滑动
  • 【跃迁之路】【444天】程序员高效学习方法论探索系列(实验阶段201-2018.04.25)...
  • laravel5.5 视图共享数据
  • Service Worker
  • SpringBoot 实战 (三) | 配置文件详解
  • 好的网址,关于.net 4.0 ,vs 2010
  • 互联网大裁员:Java程序员失工作,焉知不能进ali?
  • 快速体验 Sentinel 集群限流功能,只需简单几步
  • 前端代码风格自动化系列(二)之Commitlint
  • 如何合理的规划jvm性能调优
  • 在electron中实现跨域请求,无需更改服务器端设置
  • 掌握面试——弹出框的实现(一道题中包含布局/js设计模式)
  • 最简单的无缝轮播
  • ​总结MySQL 的一些知识点:MySQL 选择数据库​
  • #控制台大学课堂点名问题_课堂随机点名
  • #我与Java虚拟机的故事#连载12:一本书带我深入Java领域
  • $ is not function   和JQUERY 命名 冲突的解说 Jquer问题 (
  • ()、[]、{}、(())、[[]]命令替换
  • (01)ORB-SLAM2源码无死角解析-(66) BA优化(g2o)→闭环线程:Optimizer::GlobalBundleAdjustemnt→全局优化
  • (2)Java 简介
  • (C#)Windows Shell 外壳编程系列4 - 上下文菜单(iContextMenu)(二)嵌入菜单和执行命令...
  • (Matlab)遗传算法优化的BP神经网络实现回归预测
  • (Redis使用系列) Springboot 使用redis实现接口幂等性拦截 十一
  • (动态规划)5. 最长回文子串 java解决
  • (附源码)springboot社区居家养老互助服务管理平台 毕业设计 062027
  • (算法设计与分析)第一章算法概述-习题
  • (一)VirtualBox安装增强功能
  • (转)大道至简,职场上做人做事做管理
  • ./configure、make、make install 命令
  • .Net Core和.Net Standard直观理解
  • .Net 中的反射(动态创建类型实例) - Part.4(转自http://www.tracefact.net/CLR-and-Framework/Reflection-Part4.aspx)...
  • .NET企业级应用架构设计系列之开场白
  • .sh文件怎么运行_创建优化的Go镜像文件以及踩过的坑
  • @31省区市高考时间表来了,祝考试成功
  • @EnableAsync和@Async开始异步任务支持
  • @Valid和@NotNull字段校验使用
  • [ vulhub漏洞复现篇 ] struts2远程代码执行漏洞 S2-005 (CVE-2010-1870)
  • [].shift.call( arguments ) 和 [].slice.call( arguments )
  • []使用 Tortoise SVN 创建 Externals 外部引用目录
  • [20180224]expdp query 写法问题.txt