Well, one way can be that after you get the error message in action. Dump it in a hidden
string property on the jsp ( getter and setter for the property will be in form bean).
Then, on page load i.e. in the body tag there is a "onload" event. You can write a javascript method that will be called on load of your corrsponding jsp. the javascript function will access the hidden property.
e.g.
Suppose hidden tag is :
Then on body tag
The javascript function can be something like :