The implementation that Spring builds upon doesn't expose receiving pings to user code and just automatically responds with a pong when receiving a ping.
It's the same as this question for JSR 356:
Receiving pings with Java EE Websocket API
However... looking at this Chrome bug, it seems that browsers don't necessarily send ping requests.
So you could send pings from the server, implement something equivalent in JS or just rely on the client reconnecting when the connection drops.
There's some discussion here: Sending websocket ping/pong frame from browser