there is a form with a submit that logs in a user
<div class="logInDIV">
<form action="login.do" target="login.do" method="post">
<span style="font-size:77%;">
<label>email:</label>
<input path="userName" cssClass="textfield" cssStyle="width:160px;" title="user name" name="userName" type="text" />
<label>password:</label>
<input path="password" cssClass="textfield" cssStyle="width:160px;" name="password" type="password" />
<input value="Login" class="button" type="submit" style="margin-bottom:4px" />
</span>
</form>
</div>
and the corresponding controller method:
@RequestMapping(value = "/login.do", method = RequestMethod.POST)
public String doLogin(
@RequestParam(value = "userName") String userName,
@RequestParam(value = "password") String password,
HttpSession session) {
logger.info("login.do : userName=" + userName + ", password=" + password);
SkunkPostUser skunkPostUser = null;
try {
skunkPostUser = profileService.getSkunkPostUser(userName, password);
} catch (SkunkPostUserNotFoundException userNotFoundException) {
return "login";
}
session.setAttribute("skunkPostUser", skunkPostUser);
return "redirect:/";
}
for some reason when I click the submit log in button it always opens a new tab, not sure why, does anyone know?