I'm doing the login for our system and the index.html has this script,
<script>
$('#navbar').load('navbar.html');
$('#errorMessage').hide();
$("#loginBtn").click(function() {
$.post('http://localhost:8080/NewDesignV1/login.action',
{
username : $("#username").val(),
password : $("#password").val()
}
,'html');
});
</script>
The post location is a servlet, I need to go to this servlet so I could get the data from index.html, manipulate it and redirect it to a JSP page.
My problem is, I can get the data from ajax post but it won't redirect to a JSP page when I use
request.setAttribute("key", value);
request.getRequestDispatcher("studentprofile.jsp").forward(request, response);