Join Slack
Powered by
is there a way to get Spring web to return a 404 i...
# spring
f
fred.deschenes
03/01/2018, 3:16 PM
is there a way to get Spring web to return a 404 if my controller returns an
Optional
that is not present?
c
Czar
03/01/2018, 3:21 PM
Probably you'll need to write a message convertor. This really isn't a Kotlin question though, head to
stackoverflow
f
fred.deschenes
03/01/2018, 3:33 PM
yeah I tried searching Google/StackOverflow but couldn't find anything relating to responses, I'll have a look at message converters, thx
c
Czar
03/01/2018, 4:05 PM
StackOverflow is not only for searching for answers but also for asking for them 😉
➕ 1
👍 2
r
Rafael Chaves
03/01/2018, 5:47 PM
Unsolicited advice: it'd be much easier and IMHO better modeling to map a suitable exception to a 404
3
Views
Open in Slack
Previous
Next