java:springmvc

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentes Révision précédente
Prochaine révision
Révision précédente
java:springmvc [2018/09/19 20:50] jcheronjava:springmvc [2019/08/31 14:21] (Version actuelle) – modification externe 127.0.0.1
Ligne 12: Ligne 12:
 ===== Spring MVC controller ===== ===== Spring MVC controller =====
  
-Avec Spring MVC, le controller reçoit les requêtes HTTP et fournit une réponse. Il comporte l'annotation **[[https://docs.spring.io/spring/docs/current/spring-framework-reference/web.html#mvc-controller|@Controller]]**+Avec Spring MVC, un contrôleur comporte l'annotation **[[https://docs.spring.io/spring/docs/current/spring-framework-reference/web.html#mvc-controller|@Controller]]**
 +Il reçoit les requêtes Http en réponses aux RequestMappings définis grâce aux annotations  et fournit une réponse Http 
 + 
 +<sxh java> 
 + 
 +@Controller 
 +public class HelloController { 
 + 
 + @GetMapping("/hello"
 + public @ResponseBody String index() { 
 + return "Hello world!"; 
 +
 +
 + 
 +</sxh>
  
  
  • java/springmvc.1537383018.txt.gz
  • Dernière modification : il y a 6 ans
  • (modification externe)