Shouldn't the server validate the name & password? I guess so.
So let the server answer with a suitable return value:
In case of true / "pass" you should grant access, in case of false / "no pass" you should present another page.
EDIT:
So you do NOT do Server-Requests. Then you should also not use a HTTPServlet.
public class SimpleServlet extends GenericServlet {
public void service(ServletRequest request, ServletResponse response)
throws ServletException, IOException {
String strParam = request.getParameter("param");
String strNick = request.getParamter("nick");
String strPW = request.getParamter("pw");
if("login".equals(strParam) ){
}
else if("dolly".equals(strNick) && "dolly".equals(strPW) ){
response.getWriter().write("<html><body>Login granted</body></html>");
}
else {
response.getWriter().write("<html><body>OOOPS!</body></html>");
}
}
}
You simply present login (as you do in your code now) and call an internal function on click "login" to check the static nick/pw.
After that, you present