How to set email notification using struts.Plz give the
example code?
Answers were Sorted based on User's Feedback
Answer / vijay satlawar
There is no seperate mechanism in struts to send mail.
To send mails you need to use mail API by downloadimg mail.jar.
This needs SMTP port to be enabled in the system which needs
to send mail alerts.
| Is This Answer Correct ? | 4 Yes | 0 No |
Answer / achappan
It is not a correct solution for Email-notification
| Is This Answer Correct ? | 0 Yes | 3 No |
Answer / anas
Solution is to implement an email notification system. The
notification system will generate an email message whenever
the application detects an error. If you are already using
a standard logging framework like log4j.
import java.util.logging.*;
public class JDKLoggingExample
{
private static final Logger log =
Logger.getLogger(JDKLoggingExample.class.getName());
public static void main(String[] args)
{
try
{
log.fine("This is a fine message.");
int i = Integer.parseInt("Hello world");
}
catch (java.lang.Exception ex)
{
log.log(Level.SEVERE, "Caught an exception",
ex);
}
}
---------------------------------------------------------
import org.apache.log4j.*;
public class Log4jExample
{
private static final Logger log =
Logger.getLogger(Log4jExample.class);
public static void main(String[] args)
{
try
{
log.debug("This is a debug message.");
int i = Integer.parseInt("Hello world");
}
catch (java.lang.Exception ex)
{
log.error("Caught an exception", ex);
}
}
}
| Is This Answer Correct ? | 3 Yes | 11 No |
Difference between struts1.2 and struts2.0?
3 Answers Bank Of America, HCL, Value Labs,
what is the difference between model1 and model2 architecture in struts?
What is form bean in struts?
Describe validate() and reset() methods.
When it’s useful to use IncludeAction?
What is xml based validation in struts2?
Can u call Action class methods fro struts-config.xml file?
What is actionservlet?
What is the purpose of @customvalidator annotation?
What is defeult result type?
Which class is the Front Controller in Struts2?
What does the term struts mean?