2019独角兽企业重金招聘Python工程师标准>>>

开篇准备:

你得有准备jello(FIS-java解决方案),npm,maven.

开整:

  1. 编写maven配置文件

    <?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.example</groupId><artifactId>spring-io</artifactId><version>1.0.0-SNAPSHOT</version><properties><project.build.sourceEncoding>UTF-8</project.build.sourceEncoding><fastjson.version>1.2.4</fastjson.version><guava.version>18.0</guava.version></properties><parent><groupId>io.spring.platform</groupId><artifactId>platform-bom</artifactId><version>2.0.0.BUILD-SNAPSHOT</version><relativePath/></parent><dependencies><dependency><groupId>org.springframework</groupId><artifactId>spring-core</artifactId></dependency><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-web</artifactId></dependency><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-velocity</artifactId></dependency><dependency><groupId>com.baidu.fis.velocity</groupId><artifactId>fis-velocity-tools</artifactId><version>1.8</version></dependency><dependency><groupId>com.alibaba</groupId><artifactId>fastjson</artifactId><version>${fastjson.version}</version></dependency><dependency><groupId>com.google.guava</groupId><artifactId>guava</artifactId><version>${guava.version}</version></dependency><dependency><groupId>xstream</groupId><artifactId>xstream</artifactId><version>1.2.2</version></dependency><dependency><groupId>junit</groupId><artifactId>junit</artifactId><version>4.12</version></dependency><dependency><groupId>ognl</groupId><artifactId>ognl</artifactId><version>3.0.11</version></dependency></dependencies><repositories><repository><id>spring-snapshots</id><url>http://repo.spring.io/libs-snapshot</url><snapshots><enabled>true</enabled></snapshots></repository></repositories><pluginRepositories><pluginRepository><id>spring-snapshots</id><url>http://repo.spring.io/libs-snapshot</url><snapshots><enabled>true</enabled></snapshots></pluginRepository></pluginRepositories><build><plugins><plugin><groupId>org.springframework.boot</groupId><artifactId>spring-boot-maven-plugin</artifactId></plugin><plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-surefire-plugin</artifactId><configuration><useSystemClassLoader>false</useSystemClassLoader></configuration></plugin></plugins></build></project>
  2. 编写启动类

    package com.hstart;import com.baidu.fis.velocity.spring.FisBean;
    import org.springframework.boot.SpringApplication;
    import org.springframework.boot.autoconfigure.SpringBootApplication;
    import org.springframework.context.annotation.Bean;
    import org.springframework.web.filter.CharacterEncodingFilter;import javax.servlet.Filter;/*** @author daihy* @since 2015/7/15*/
    @SpringBootApplication
    public class Application {@Beanpublic Filter characterEncodingFilter() {CharacterEncodingFilter characterEncodingFilter = new CharacterEncodingFilter();characterEncodingFilter.setEncoding("UTF-8");characterEncodingFilter.setForceEncoding(true);return characterEncodingFilter;}@Beanpublic FisBean fisBean(){return new FisBean();}public static void main(String[] args) throws Exception {SpringApplication.run(Application.class, args);}}
  3. 配置velocity和其他参数

    被YAML坑了一回,第一次用,分层结构不能使用Tab字符,否则等着哭吧

  4. 运行

    然后你就可以愉快的在浏览器敲上localhost:8080就能看到spring-boot启动了,我启动时是这样的,你启动的时候也会是这样的♥

  5. Game Over

    打开页面ζ 最后是这样的,后面会介绍jello velocity的开发和一些细节

转载于:https://my.oschina.net/luoyezhiqiu/blog/492978

Spring Boot遇上jello相关推荐

  1. 理论 | 当 Spring Boot 遇上了消息队列......

    这是小小本周的第五篇,当Spring Boot 遇上了消息队列. Spring Boot 1.0 版本 在很远很远的以前,作为单体应用,只有一个Spring Boot 应用,当两个Spring Boo ...

  2. 当 Spring Cloud 遇上 SOFAStack | Meetup#2 回顾

    本文作者:玄北(曹杰),蚂蚁金服 SOFAStack 开源组核心成员. 导读:本文根据 5月26日 SOFA Meetup#2 上海站 <当 Spring Cloud 遇上 SOFAStack& ...

  3. vueform表单文件上传_峰哥说技术系列-8.Spring Boot文件上传(Form表单和Ajax方式)

    今日份主题 Spring Boot文件上传(Form表单和Ajax方式) 在Spring Boot中,和文件上传的主要和MultipartResolver接口有关,他有两个实现类 StandardSe ...

  4. Spring Boot 批量上传: The field files exceeds its maximum permitted size of 1048576 bytes.

    Spring Boot 批量上传异常: org.apache.tomcat.util.http.fileupload.FileUploadBase$FileSizeLimitExceededExcep ...

  5. Spring Boot:上传文件大小超限制如何捕获 MaxUploadSizeExceededException 异常

    Spring Boot 默认上传文件大小限制是 1MB,默认单次请求大小是 10MB,超出大小会跑出 MaxUploadSizeExceededException 异常. 问题来了,当文件超过 1M ...

  6. Spring boot项目上传Linux服务器后 上传图片后,图片路径报404,图片路径映射问题

    问题 spring boot项目上传到Linux服务器后,头像上传后报404.但是我的打包的jar包在idea客户端运行是没问题的 解决 错误代码 @Overridepublic void addRe ...

  7. 全栈开发实战|Spring Boot文件上传与下载

    文件上传与下载是Web应用开发中常用的功能之一.接下来我们将讨论如何在Spring Boot的Web应用开发中,如何实现文件的上传与下载. 01.Spring Boot文件上传与下载 在实际的Web应 ...

  8. Spring Boot文件上传及回显(单/多文件)

    一.单文件上传 1.前端页面 <!DOCTYPE html> <html lang="en"> <head><meta charset=& ...

  9. spring boot 文件上传工具类(bug 已修改)

    以前的文件上传都是之前前辈写的,现在自己来写一个,大家可以看看,有什么问题可以在评论中提出来. 写的这个文件上传是在spring boot 2.0中测试的,测试了,可以正常上传,下面贴代码 第一步:引 ...

最新文章

  1. 磁盘分区标为活动的方法及取消磁盘分区标为活动的方法
  2. numpy.concatenate详解
  3. python while-Python天坑系列(一):while 1比while True更快?
  4. 一女程序员被判 9 个月:因薪酬等问题离职,rm -f * 删库,瘫痪 6 个小时
  5. android消息队列模型,Android 消息队列机制
  6. linux文件系统基础知识
  7. 大数据治理体系如何搭建
  8. 视频剪辑软件对比之:会声会影与剪映
  9. 商用密码应用安全性评估
  10. RISC-V MCU 应用教程之RTC自动唤醒
  11. javascript实现常用的设计模式
  12. Most of the disks failed
  13. EasyUI(DataGrid修改删除)
  14. 服务器dns被劫持如何修复,电脑DNS被劫持如何解决?电脑DNS被劫持的解决方法
  15. 2021 上海科技大学信息学院SIST夏令营经验+记录贴
  16. JavaWeb开发专题(一)-JavaWeb入门
  17. 1969年美国(阿波罗)登月真伪
  18. 冷启动、微创新、产品思维,一家AI公司孵化输入法的跋涉之路
  19. anki计算机知识,「背书 刷题神器」 Anki 是应对考试的强力效率 buff
  20. 《UnityAPI.ScriptableObject脚本化对象》(Yanlz+Unity+SteamVR+云技术+5G+AI+VR云游戏+CreateInstance+List+立钻哥哥++OK++)

热门文章

  1. 移动appium测试必知必会(一)
  2. GitHub云扫描器
  3. 微信开发实战(1)—申请注册测试号
  4. js中的函数、预编译、DOM的引入
  5. 基于高德地图的足迹 APP原型
  6. html中的左浮动的作用,CSS浮动
  7. 游戏耳机的新选择,西圣olaf电竞耳机,吃鸡快人一步
  8. Leetcode典型题解答和分析、归纳和汇总——T35(搜索插入位置)
  9. python 邮件服务器地址_Salmon---一个基于Python语言的邮件服务器
  10. 捋一捋Python中的Dict(上)