How to set email notification using struts.Plz give the
example code?
Answer Posted / 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 |
Post New Answer View All Answers
What are the major differences between html tags and strut specific html tags?
Why it called struts?
What is the purpose of @emailvalidator?
What is apache struts used for?
What is the purpose of @createifnull annotation annotation?
What is the purpose of @conversion annotation annotation?
Do we need to pay the struts if being used in commercial purpose?
what is meant by Struts Validator Framework?
Explain about the
What is role of actionservlet?
What do you mean by ognl?
What is front controller in struts?
Describe the mvc on struts?
What are the steps required for setting up validator framework in struts?
What is difference between interceptors and filters?