lundi 22 juin 2020

One parameter (@RequestParam String tab) - many methods

I get "tab" from front, his value can be 'profile', 'active', 'summary', 'votes' etc. Each value has its own method. How can I call a method based on the value of 'tab' without using switch and if. Are there any patterns for this case?

Aucun commentaire:

Enregistrer un commentaire