Skip to content
Advertisement

SPRING MVC : How to pass the radio button value which is clicked to controller?

I am using Spring MVC controller.

Is it possible to set an object in the path value in a radio button ?

below my form inside my jsp

JavaScript

And my controller

JavaScript

Here is my AddressForm

JavaScript

I want to retrieve the selected object address from my controller but I have an Error bindingResult.hasErrors() return true with the following error and form with address null

JavaScript

Advertisement

Answer

I suggest you to pass in the path the address id like that :

JavaScript

And you recover in your action the address by id or code since you already have list.

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement