I've written a simple html/servlet program that has a user enter their name and password on a form and then either register or login using a submit button. I have the program working, except when a user doesn't fill in either of the text fields I can't figure out how to get it to print to the page. Right now I just have it printing to my Eclipse console which is not what I want. What am I missing? BTW, I'm very new to
Java.
HTML code:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Cookies</title>
</head>
<body>
<form action="http://localhost:8080/Project/Main">
<center>
User Name: <input name="name" type="text" value="">
Password: <input name="password" type="password" value="">
<input name="register" type="Submit" value="Register">
<input name="login" type="Submit" value=" Login ">
</center>
</form>
</body>
</html>
Servlet code: