zoukankan      html  css  js  c++  java
  • Chapter1Main

    <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>chapterone</groupId>
        <artifactId>chapterone</artifactId>
        <version>0.0.1-SNAPSHOT</version>
    
        <parent>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-parent</artifactId>
            <version>2.0.0.RELEASE</version>
            <relativePath /> <!-- lookup parent from repository -->
        </parent>
    
        <properties>
            <!-- 声明项目配置依赖编码格式为 utf-8 -->
            <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
            <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
            <fastjson.version>1.2.24</fastjson.version>
        </properties>
    
        <dependencies>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-web</artifactId>
            </dependency>
            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>3.8.1</version><!--$NO-MVN-MAN-VER$-->
                <scope>test</scope>
            </dependency>
        </dependencies>
    
        <build>
            <plugins>
                <plugin>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <configuration>
                        <source>1.8</source>
                        <target>1.8</target>
                    </configuration>
                </plugin>
            </plugins>
        </build>
    </project>
    package com.springboot.chapter1.main;
    
    import java.util.HashMap;
    import java.util.Map;
    
    import org.springframework.boot.SpringApplication;
    import org.springframework.boot.autoconfigure.SpringBootApplication;
    import org.springframework.stereotype.Controller;
    import org.springframework.web.bind.annotation.RequestMapping;
    import org.springframework.web.bind.annotation.ResponseBody;
    
    @SpringBootApplication
    @Controller
    public class Chapter1Main {
        public static void main(String[] args) {
            SpringApplication.run(Chapter1Main.class, args);
        }
    
        @RequestMapping("/test")
        @ResponseBody
        public Map<String, String> test() {
            Map<String, String> map = new HashMap<>();
            map.put("key1", "value1");
            return map;
        }
    }

  • 相关阅读:
    解决 SQL Server Profiler 跟踪[不断]出现检索数据
    Linq表达式开窍
    CSS3——动画效果
    MongoDB学习与BUG解答
    MongoDB 客户端 MongoVue
    Memcached——分布式缓存
    WRONGTYPE Operation against a key holding the wrong kind of value
    Redis——分布式简单使用
    HTML5——播放器
    HTML5——行走日记
  • 原文地址:https://www.cnblogs.com/tszr/p/15494068.html
Copyright © 2011-2022 走看看