Archana Annamaneni [mailto:[EMAIL PROTECTED] wrote: > I am doing an application using the struts,in that I have a mail sending option > using the Java Mail.For this i don't want to hard code the SMTP server name into > the application,user should be able to read it from struts-config.xml or web.xml. > What is the best way to achieve this using the struts. > There is really not much information on the web.
Probably because it's not a Struts-specific issue. In your case, I'd have the Action code calling some object's 'send' method. The Struts code would have no idea that JavaMail was involved. (Encapsulation, same as separating data access from Struts code.) I'd probably just do a simple .properties file, because they are so easy to work with. Things are moving in the XML direction, but sometimes it's more trouble than it's worth. So the question of how the Mail code should figure out what the SMTP server's address is has turned into a question that has nothing at all to do with Struts, which is why you're not finding much out there. Sure, you can tie your Mail code tightly to Struts, but then you can't use it anywhere else. -- Wendy Smoak Applications Systems Analyst, Sr. Arizona State University, PA, IRM --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

