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 classes used as part of struts framework ?
Will the struts tags support other markup languages such as wml ?
What is value stack?
In which method of action class the business logic is executed?
What is apache struts used for?
1.can we transfer a request from one struts application to another struts application? 2. how many types of action servlets r there what r they
How do I install struts?
Explain the difference between jakarta struts and apache struts?
How does interceptor work in struts2?
What are the 5 constants of action interface?
What is a custom tag?
Which design pattern the interceptors in struts2 is based on?
in struts how to use hibernate with struts>
What is the purpose of form-be tag in struct-config.xml?
How is a lookup dispatch action created?