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) { } catch (LDAPException ldape) {
//TODO create error page logger.error("LDAP error", ldape);
logger.error("LDAP error" + ldape);
response.sendRedirect("./error.jsp"); response.sendRedirect("./error.jsp");
} catch (MessagingException e) { } catch (MessagingException e) {

View File

@ -55,10 +55,8 @@ public class RemindUsernameServlet extends HttpServlet {
String verificationCodeSubject = "Your OpenAIRE username"; String verificationCodeSubject = "Your OpenAIRE username";
emailSender.sendEmail(formEmail, verificationCodeSubject, verificationCodeMsg); emailSender.sendEmail(formEmail, verificationCodeSubject, verificationCodeMsg);
} else { } else {
request.getSession().setAttribute("message", "User not found"); request.getSession().setAttribute("message", "User not found");
response.sendRedirect("./remindUsername.jsp"); response.sendRedirect("./remindUsername.jsp");

View File

@ -48,6 +48,8 @@ public class VerificationCodeServlet extends HttpServlet {
printWriter.close(); printWriter.close();
} else { } 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 // response.sendRedirect("./error.jsp"); or write a message in the session
} }