• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

java mail through jsp

 
Greenhorn
Posts: 2
Netbeans IDE Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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

javax.mail.Authenticator {
public PasswordAuthentication

getPasswordAuthentication() {
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.
 
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
God is a comedian playing for an audience that is afraid to laugh - Voltair. tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic