Skip to content
Advertisement

How can I use more then one param in a spring boot rest Controller?

I want to achive the follwing URL to access my data with 2 params:

http://localhost:8080/contactnote?entryDate=2022-02-01?contactType=T

Both mappings with a single param is working:

JavaScript

But when I try to combine them with two params it wont work, not one of them is usable.

JavaScript

My reposiitory looks like this:

JavaScript

Advertisement

Answer

the URL you entered is invalid, double ?, you have to use & for the second parameter

correct one: http://localhost:8080/contactnote?entryDate=2022-02-01&contactType=T

this code work, use name instead value

JavaScript

enter image description here

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