ok, so I suppose that the pop up is going to be javascript. Are you going to use js library for that? like jQuery?
if so, then write error inside for example div with class error ,and write javascript that will check if class error exists.
if it does, hide it and display content in a pop up.
I can't see how this is related to spring, maybe
you should try searching javascript forums