conchincradle / tech-community

A forum project developed by Java
0 stars 0 forks source link

controller example #5

Open conchincradle opened 1 year ago

conchincradle commented 1 year ago

package com.zhu.techcommunity.controller;

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

@Controller @RequestMapping("/hello") public class HelloController { @RequestMapping("/hello") @ResponseBody public String sayHello(){ return "Hello! Spring Boot!"; }

}

conchincradle commented 1 year ago

access the link

http://localhost:8080/tech-community/hello/hello

Hello class - > hello so hello/hello

and tech-community default path

conchincradle commented 1 year ago

image