Skip to content

FeDemo/springboot_1_hello-world

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

springboot_1_hello world

springboot demo

hello world

@RestController
@SpringBootApplication
public class DemoApplication {

	public static void main(String[] args) {
		SpringApplication.run(DemoApplication.class, args);
	}

	@RequestMapping({ "/", "/index" ,""})
	public String index(){
		return "hello springboot";
	}

	@RequestMapping("json")
	public Map json(){
		Map m=new HashMap();
		m.put("index1","str1");
		m.put("index2","str2");
		m.put("index3","str3");
		return m;
	}
}

index

json

About

springboot 返回json以及text

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages