如果使用@RestController,那麼controller裏面的方法如果返回字符串,就是返回字符串本身,不能跳轉頁面
如果使用@Controller,不使用@Responsebody,返回字符串的適合,默認跳轉
如果使用@Controller,使用@Responsebody,返回字符串的適合,直接返回字符串本身
@RestController=@Controller+@Responsebody
如果使用@RestController,那麼controller裏面的方法如果返回字符串,就是返回字符串本身,不能跳轉頁面
如果使用@Controller,不使用@Responsebody,返回字符串的適合,默認跳轉
如果使用@Controller,使用@Responsebody,返回字符串的適合,直接返回字符串本身
不摸魚了,直接上代碼! 也參考了網上很多資料,請理解! <build> <plugins> <plugin> <artifactId>maven-compiler-plugin</arti
下面請看一段代碼,父類(基類)SuperClass,子類(派生類)SubClass class SuperClass { private int n; SuperClass(int n) {