This week's book giveaway is in the Mac OS forum. We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line! See this thread for details.
if you want to display error message near to the particular field,then you can go for ajax or serverside validation...
if you go serverside validation then using expression(or sriptlet)we can display message ..where ever you want..but page will be refresh..so, you go for ajax(example you see gmail login page by giving wrong username ..you want that type only right?)
Explore the innerHTML property of DOM elements to see how to add content to an element.
With regards to validation: while client-side validation is nice for the user, your server code should never rely upon it and should always re-validate the data regardless of whether it was validated on the client or not.