3

In PHP there is the possibility to recognize a parameter in the address bar by passing it in the controller's method ; for example :

http://192.168.2.49/papsp/index.php/meeting/modif/3

In this example the data 3 is taken as parameter value for the meeting controller's method modif :

public modif($key) { ... }

So how to proceed analogically in Spring ?

cнŝdk
  • 31,391
  • 7
  • 56
  • 78
pheromix
  • 18,213
  • 29
  • 88
  • 158

1 Answers1

6

You need to use the @RequestMapping annotation, along with @PathVariable with your method param. And your url will be like this /meeting/modif/{key}.

Here's how should be your code:

@RequestMapping(value = "/meeting/modif/{key}", method = RequestMethod.POST)
public void modif(@PathVariable int key) {
cнŝdk
  • 31,391
  • 7
  • 56
  • 78