In this I'm performing the validation in servlet to check whether the user already exists or not, I'm entering the username in JSP then the value is passed to the servlets.
I have used the following code in servlet for redirecting to JSP.
"request.setAttribute("errorMessage",true);"
and in JSP I used the following code to retrieve the attribute
<%
if(request.getAttribute("errorMessage") != null ){
%>
<%
}
%>
Inside the loop I have to call the JavaScript to show alert in the JSP.
Can anybody help me to process further. Thanks in advance