This is a servlet to accept a username through a form on a web page and reply with a mail containing the user's password from the tomcat password file.
The source is available below. Username patterns and corresponding hosts must be configured in web.xml.