Revision 49412
Added by Sofia Baltzi over 6 years ago
RemindUsernameServlet.java | ||
---|---|---|
8 | 8 |
import org.springframework.stereotype.Component; |
9 | 9 |
import org.springframework.web.context.support.SpringBeanAutowiringSupport; |
10 | 10 |
|
11 |
import javax.mail.MessagingException; |
|
11 | 12 |
import javax.servlet.ServletConfig; |
12 | 13 |
import javax.servlet.ServletException; |
13 | 14 |
import javax.servlet.http.HttpServlet; |
... | ... | |
54 | 55 |
|
55 | 56 |
String verificationCodeSubject = "Your OpenAIRE username"; |
56 | 57 |
|
57 |
emailSender.sendEmail(formEmail, verificationCodeSubject, verificationCodeMsg); |
|
58 | 58 |
|
59 |
emailSender.sendEmail(formEmail, verificationCodeSubject, verificationCodeMsg); |
|
60 |
|
|
61 |
|
|
59 | 62 |
} else { |
60 | 63 |
request.getSession().setAttribute("message", "User not found"); |
61 | 64 |
response.sendRedirect("./remindUsername.jsp"); |
... | ... | |
65 | 68 |
//TODO create error page |
66 | 69 |
logger.error("Could not find user with email " + formEmail, ldape); |
67 | 70 |
response.sendRedirect("./error.jsp"); |
71 |
|
|
72 |
} catch (MessagingException e) { |
|
73 |
logger.error("Error in sending email", e); |
|
74 |
response.sendRedirect("./error.jsp"); |
|
68 | 75 |
} |
76 |
|
|
69 | 77 |
} |
70 | 78 |
|
71 | 79 |
} |
Also available in: Unified diff
Fix exceptions and errors