Reputation: 2265
I have servlet that sends email:
msg.setContent("<p>Please follow this <a href=\"http://localhost:8080/examples/RSI/ConfirmedResetPasswordPage.jsp?action=<%=userID%>\"> link </a>to reset your password",
"text/html" );
Does anyone know how to make this link a relative path to ConfirmedResetPasswordPage.jsp page?
Upvotes: 0
Views: 42
Reputation: 8057
You can't put relative path in the email. Assuming that you mean, you don't want to hardcode the server url and you have access to HTTPServletRequest request
object, you can use request.getServerName()
or request.getRequestURL()
methods to figure out server url.
Upvotes: 1