<html>
	<head>
		<title>A JSP Page </title>
		<body bgcolor="lightyellow">
		<% 
			String firstname = request.getParameter("fname");
			String lastname  = request.getParameter("lname");
			String emailAddr = request.getParameter("email");

        	if (firstname == null) firstname = "";              //http puts null, change to ""
        	if (lastname  == null) lastname  = "";
        	if (emailAddr == null) emailAddr = "";

			if (firstname.equals(""))
				out.print("<span style='color:red'>Please enter first name</span><br/>");
			if (lastname.equals(""))
				out.print("<span style='color:red'>Please enter last name</span><br/>");
			if (emailAddr.equals(""))
				out.print("<span style='color:red'>Please enter email address</span><br/>");
		%>

		<h1>You Entered: </h1>
		<table>
			<tr>
				<td>First Name: </td>
				<td>  <%= firstname %>  </td>
			</tr>
			<tr>
				<td>Last Name: </td>
				<td>  <%= lastname %>  </td>
			</tr>
			<tr>
				<td>Email Address: </td>
				<td>  <%= emailAddr %>  </td>
			</tr>
		</table>
		<p>You can also enter your name after the URL in the form of: <br />
		<b> url?fname=xxxx&lname=yyyy&email=zzzz </b></p>
	</body>
</html>