Skip to content

Instantly share code, notes, and snippets.

@dineshkp-dev
Last active August 29, 2015 14:13
Show Gist options
  • Save dineshkp-dev/7230d6ab136c982f46a6 to your computer and use it in GitHub Desktop.
Save dineshkp-dev/7230d6ab136c982f46a6 to your computer and use it in GitHub Desktop.
index 'Log-in' page for Dynamic Web Page
<!DOCTYPE html> <!-- Implies that this is a HTML5 Page! -->
<html>
<head>
<meta charset="ISO-8859-1">
<!-- The below line shows the 'title' for the page, it should be placed within the '<head></head>' tags -->
<title>Welcome to the My Shopping Page</title>
</head>
<!-- The below is the body of our HTML page -->
<body>
<h1 align="center">Please log-in to the Shopping site</h1>
<br><hr><br>
<!-- IMPORTANT: -->
<!-- The 'form' tag's 'action' attribute determines which JSP page recieves the data from this FORM when it is submitted -->
<!-- The 'method' attribute determines if the data will be sent as 'POST' response (used to send secure information), the other option is 'GET' -->
<form action="LoginServlet" method="post">
<!-- Create a table to align the Text boxes and Labels in the HTML page -->
<table align="center" border="1" cellpadding="5">
<tr>
<!-- 'colspan' attribute can be used to merge two columns -->
<td colspan="2"><h3>Please enter your username and password</h3></td>
</tr>
<tr>
<td>Username:</td>
<!-- Get the user name from the user through this text box below -->
<td align="middle"><input type="text" name="uname" size="32" value=""></td>
</tr>
<tr>
<td>Password: </td>
<!-- Get the password through another text box -->
<td align="middle"><input type="password" name="pwd" size="32" value=""></td>
</tr>
<br><br>
<tr>
<td colspan="2" align="center">
<table border="0" cellpadding="10">
<!-- Create a 'submit' button to pass the data to the Java Servlet -->
<td><button type="submit" name="submitBtn">Submit</button></td>
<!-- Create 'reset' button to allow user to reset the form -->
<td><button type="reset" name="resetBtn">Reset</button></td>
</table>
</td>
</tr>
</table>
</form>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment