gudii9
asked on
login form jsp example
Hi,
I am working on below example
http://mrbool.com/how-to-create-a-login-form-with-jsp/25685
my login.html is
my LoginCheck.jsp is
i ran application and entered anurag and jain as username and password within login.html
i expected to go to LoginCheck.jsp but getting below error
http://localhost:9999/FinalWeb/Home.jsp
please advise
HTTP Status 404 - /FinalWeb/Home.jsp
type Status report
message /FinalWeb/Home.jsp
description The requested resource is not available.
Apache Tomcat/7.0.47
not sure where Home.jsp came in picture??
my intention is once login successful come to a page with 4 different links like menu.
one link says create account
second link say perform credit operatin
then show like receipt etc
I am working on below example
http://mrbool.com/how-to-create-a-login-form-with-jsp/25685
my login.html is
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
</head>
<body>
<h1>Login Page</h1>
<center>
<h2>Signup Details</h2>
<form action="LoginCheck.jsp" method="post">
<br />Username:<input type="text" name="username"> <br />Password:<input
type="password" name="password"> <br />
<input type="submit" value="Submit">
</form>
</center>
</body>
</html>
my LoginCheck.jsp is
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
</head>
<body>
<%
String username = request.getParameter("username");
String password = request.getParameter("password");
if ((username.equals("anurag") && password.equals("jain"))) {
session.setAttribute("username", username);
response.sendRedirect("Home.jsp");
} else
response.sendRedirect("Error.jsp");
%>
</body>
</html>
i ran application and entered anurag and jain as username and password within login.html
i expected to go to LoginCheck.jsp but getting below error
http://localhost:9999/FinalWeb/Home.jsp
please advise
HTTP Status 404 - /FinalWeb/Home.jsp
type Status report
message /FinalWeb/Home.jsp
description The requested resource is not available.
Apache Tomcat/7.0.47
not sure where Home.jsp came in picture??
my intention is once login successful come to a page with 4 different links like menu.
one link says create account
second link say perform credit operatin
then show like receipt etc
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER