AJAX is the best way to achive this. As you are saying that you are a beginner in Java technologies, I am giving normal solution.
-- In the method validateSelect(val), first validate the value passed.
-- If the passed value satisifies the required condition, set a value, lets say "fetchData", to a hidden variable, lets say "condition".
-- In the FetchDataServlet(),
=> first get the value of the hidden variable "condition".
=> If the value is "fetchData", connect to database and fetch the data.
=> Send the retrieved data to the same page back. This can be done in various ways, like,
=> Creating a collection object and setting in Response object, lets say "data"
=> Creating a String value, having aligned data in a table or another format, and setting in Response object,lets say "data"
=> You can target to the same JSP.
-- In the JSP, based on the value available in "data" field, display the data in the page.
There are somany ways to achieve this. You can google the net for that examples. It is difficult to give the source code for all of this, here.
If you need further explanations, feel free to mail me @ [email protected]
Y. Keerthi Sagar.