Revision 49412
Added by Sofia Baltzi over 6 years ago
ForgotPasswordServlet.java | ||
---|---|---|
8 | 8 |
import org.springframework.beans.factory.annotation.Autowired; |
9 | 9 |
import org.springframework.web.context.support.SpringBeanAutowiringSupport; |
10 | 10 |
|
11 |
import javax.mail.MessagingException; |
|
11 | 12 |
import javax.servlet.RequestDispatcher; |
12 | 13 |
import javax.servlet.ServletConfig; |
13 | 14 |
import javax.servlet.ServletException; |
... | ... | |
87 | 88 |
|
88 | 89 |
} catch (LDAPException ldape) { |
89 | 90 |
//TODO create error page |
91 |
logger.error("LDAP error" + ldape); |
|
92 |
response.sendRedirect("./error.jsp"); |
|
93 |
|
|
94 |
} catch (MessagingException e) { |
|
90 | 95 |
request.getSession().setAttribute("message", "Error sending email."); |
91 | 96 |
response.sendRedirect("./forgotPassword.jsp"); |
92 | 97 |
} |
93 | 98 |
|
94 | 99 |
response.setContentType("text/html"); |
95 |
// try { |
|
96 |
//// request.getSession().setAttribute("email", formEmail); |
|
97 |
//// request.getSession().setAttribute("username", ldapActions.getUsername(formEmail)); |
|
98 |
//// request.setAttribute("email", formEmail); |
|
99 |
// request.setAttribute("username", ldapActions.getUsername(formEmail)); |
|
100 |
// RequestDispatcher rd = request.getRequestDispatcher("./verify.jsp"); |
|
101 |
// rd.forward(request, response); |
|
102 |
//// RequestDispatcher rd = request.getRequestDispatcher("ForgotPasswordServlet"); |
|
103 |
//// rd.forward(request, response); |
|
104 |
//// |
|
105 |
//// logger.info("Stelnwwww"); |
|
106 |
//// |
|
107 |
// } catch (LDAPException e) { |
|
108 |
// e.printStackTrace(); |
|
109 |
// logger.info("LDAP error" + e); |
|
110 |
// request.getSession().setAttribute("message", "Error getting username."); |
|
111 |
// response.sendRedirect("./forgotPassword.jsp"); |
|
112 |
// } catch (ServletException ex) { |
|
113 |
// ex.printStackTrace(); |
|
114 |
// logger.info("Dispacher error" + ex); |
|
115 |
// } |
|
116 |
|
|
117 | 100 |
response.sendRedirect("./verify.jsp"); |
118 | 101 |
} |
119 | 102 |
|
Also available in: Unified diff
Fix exceptions and errors