Hi, my question is on Java using cookies. Create the following pages: 1) A start
ID: 3685281 • Letter: H
Question
Hi, my question is on Java using cookies.
Create the following pages:
1) A starting HTML which includes a userID and a password textbox. The page will also contain as submit button and the following radio buttons:
Persistent cookie
Per-session cookie
2) The HTML page will submit to a Java Servlet. The servlet will check the users credentials (userID = wpc2, password = xyz123). If the credentials do not match, the user is redirected to the HTML page. If there is a match, the relevant cookie is set (or encoded) and the jsp page is called. The users userID will be set in the cookie.
3) The jsp page will check for the users ID to be set in a cookie. If the cookie is not set (need to check for all types), then the user is redirected to the HTML page. If the cookie is set, then the user ID is displayed on the page (derived from the cookie).
Thank you in advance, please show all the html, jsp, and classes that's needed.
Explanation / Answer
1.....
<html>
<body>
<table width="100%" border="0" align="center" bgcolor="#F7F7F7">
<tr>
<td colspan="2" align="center" bgcolor="#F7F7F7">LOGIN</td>
</tr>
<tr>
<td width="45%" height="36" align="right" bgcolor="#F7F7F7">USERNAME</td>
<td width="55%" align="left" bgcolor="#F7F7F7"><label for="label"></label>
<input type="text" name="username" id="username" placeholder="username" /></td>
</tr>
<tr>
<td height="38" align="right" bgcolor="#F7F7F7">PASSWORD</td>
<td align="left" bgcolor="#F7F7F7"><label for="password"></label>
<input type="password" name="password" id="password" placeholder="password" /></td>
</tr>
<tr>
<td height="38" align="right" bgcolor="#F7F7F7">SELECT ONE</td>
<td align="left" bgcolor="#F7F7F7"><form name="form1" method="post" action="">
<p>
<label>
<input type="radio" value="Persistent cookie">
Persistent cookie</label>
<br>
<label>
<input type="radio" value="radio">
Per-session cookie</label>
<br>
</p>
</form> <label for="password"></label></td>
</tr>
<tr>
<td colspan="2" align="center" bgcolor="#F7F7F7"><input type="submit" name="submit" id="submit" value="Submit" />
<input type="reset" name="reset" id="reset" value="Reset" /></td>
</tr>
<tr>
<td align="right" bgcolor="#F7F7F7"><font color="Blue"><a href="CHATSPACE/registration.php">New Registration</a></font></td>
<td align="center"><p><a href="CHATSPACE/fpwd.php"><font color="red">Forget password???</font></a></p></td>
</tr>
</table>
</body>
</html>
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.