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 is the default suffix for struts2 action uri ?
how does request processor relates to action mapping?
What does action do in struts?
What is the significance of logic tags in Struts?
Is Struts Framework part of J2EE?
What is the use of lookupdispatchaction?
Explain about the library tag?
How are interceptors and servlet filters different?
What is the purpose of @key annotation annotation?
Are interceptors and filters different?
Why was reload removed from struts (since 1.1)?
What are the features of struts?
What are the advantages of spring mvc over struts mvc?
What is the purpose of plug-in tag in struct-config.xml?
What is struts in java with example?