hi, i have used java mail for sending mail by making gmail as smtp server... its getting executed as and desktop application but when it comes to web application i couldn't execute it. problem is with the authentication class which is included in my application
class PasswordAuthenticator extends
String user = "****************";
String pwd = "********";
return new PasswordAuthentication(user, pwd);
this class is called in the main program, of my mail application.. how to include both the classes in web.xml file when i use servlets and how to include both main class and the above class in JSP.
You don't need to declare your authenticator class in web.xml. Neither do you need to import it in your JSP, if you are still writing antiquated JSP code which has embedded Java. All you need to do is make sure it gets deployed with your web application along with your other classes. It should go either in WEB-INF/classes or else in a jar in WEB-INF/lib.