Skip to main content

Class-Level Mapping

Learn Class-Level Mapping (Controllers, Spring MVC) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.

Fresher Notes Class-level mapping puts @RequestMapping("/base") on the controller class so every handler method inherits that path as a prefix. Method paths are added to it: class /users plus method /{id} gives /users/{id} . Benefit : no repeated prefix, and the whole controller can be moved by changing one line.

More lessons in Controllers