Instead of normal buttons you can have submit buttons and handle them in controller as below
type="submit" value="Developer" name="developer">
type="submit" value="Graphic" name="graphic">
type="submit" value="Cleaner" name="cleaner">
And you can have different methods in the controller class for each of the buttons clicked using the
params
attribute like this@RequestMapping(value = "/redirect", method = {RequestMethod.POST}, params = "developer")
public ModelAndView developerMethod(){
}
@RequestMapping(value = "/redirect", method = {RequestMethod.POST}, params = "graphic")
public ModelAndView graphicMethod(){
}
@RequestMapping(value = "/redirect", method = {RequestMethod.POST}, params = "cleaner")
public ModelAndView cleanerMethod(){
}
No comments:
Post a Comment