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
Name some of the features of struts2?
Which components are available using actioncontext map?
Difference between html tags and struts specific html tags
What is the purpose of @customvalidator annotation?
What are the Core classes of Struts Framework?
what is ACID test for fresh engineers??what is the pattern??
List some struts tag libraries?
Explain struts.devmode?
What inbuilt themes are provided by struts2?
What is the actionform?
Who makes the struts?
Can you give an overview of how a struts application flows?
What is the purpose of @element annotation annotation?
What is the configuration files used in struts?
What is actioninvocation?