Add error messages

This commit is contained in:
Sofia Baltzi 2017-10-12 14:43:11 +00:00
parent ac33445d54
commit 47f695315b
3 changed files with 4 additions and 5 deletions

View File

@ -87,8 +87,7 @@ public class ForgotPasswordServlet extends HttpServlet {
}
} catch (LDAPException ldape) {
//TODO create error page
logger.error("LDAP error" + ldape);
logger.error("LDAP error", ldape);
response.sendRedirect("./error.jsp");
} catch (MessagingException e) {

View File

@ -55,9 +55,7 @@ public class RemindUsernameServlet extends HttpServlet {
String verificationCodeSubject = "Your OpenAIRE username";
emailSender.sendEmail(formEmail, verificationCodeSubject, verificationCodeMsg);
emailSender.sendEmail(formEmail, verificationCodeSubject, verificationCodeMsg);
} else {
request.getSession().setAttribute("message", "User not found");

View File

@ -48,6 +48,8 @@ public class VerificationCodeServlet extends HttpServlet {
printWriter.close();
} else {
request.getSession().setAttribute("message", "Username or verification code are not valid.");
response.sendRedirect("./verify.jsp");
// response.sendRedirect("./error.jsp"); or write a message in the session
}