Looking to implement a basic login form using Spring MVC and an APIResponseModel class with Status, Message, HTTPStatus variables. After submitting the credentials, receiving a 404 ajax response, although the Controller returns {"status":"200","message":"Login Success!!","data":Admin}. Need assistance in resolving this issue.
Spring Controller
@RequestMapping("/login")
public APIResponseModel getLoginPage(@ModelAttribute("loginUser")UserDTO userDto, HttpSession session) {
// Code block
}
Validate login JS Function
function processLogin(e){
// Code block for processing login
}
MasterAjax class
class MasterAjax{
constructor(){
// Constructor code
}
requestData(callBack){
// Method to request data
}
}
LoginForm
<form class="page" name="loginForm">
<input class="email" id="email" path="email" type='text' align="center" placeholder="Username / Email" />
<input class="pass" id="password" path="password" type='password' align="center" placeholder="Password" />
<button class="submit" onclick="processLogin(event)">Sign in</button>
<p class="forgot" align="center"><a href="#">Forgot Password?</a></p>
</form>