spring boot的基本配置——spring boot的web开发——Thymeleaf模板引擎


 

========================================================================

<?xml version="1.0" encoding="UTF-8"?>


  4.0.0

  org.example
  anxinfu
  1.0-SNAPSHOT
  war

  anxinfu Maven Webapp
  
  http://www.example.com

  
    UTF-8
    1.7
    1.7
  

  
    org.springframework.boot
    spring-boot-starter-parent
    2.4.5
     
  


  
    
      org.springframework.boot
      spring-boot-starter-web
    
    
      org.springframework.boot
      spring-boot-starter-test
      test
    
    
    
      org.springframework.boot
      spring-boot-starter-web
    
    
      org.springframework.boot
      spring-boot-starter-thymeleaf
    
  

  
    anxinfu
    
      
        
          maven-clean-plugin
          3.1.0
        
        
        
          maven-resources-plugin
          3.0.2
        
        
          maven-compiler-plugin
          3.8.0
        
        
          maven-surefire-plugin
          2.22.1
        
        
          maven-war-plugin
          3.2.2
        
        
          maven-install-plugin
          2.5.2
        
        
          maven-deploy-plugin
          2.8.2
        
      
    
  

 




    
    Title


        hello-------spring boot


package com.test.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class StartMainController
{
    @RequestMapping("/1")
    public String home1()
    {
        return "hello";
    }

    @RequestMapping("/2")
    @ResponseBody
    public String home2()
    {
        return "123";
    }

}

  

相关