Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What are the features of struts?

968


What do you mean by ognl?

948


What steps are required to for an application migration from Struts1 to Struts2?

982


Why do we need mapdispatchtoprops?

813


What is the front controller in struts2?

889


What is actioninvocation?

899


Why aren’t the struts tags maintained as part of the jakarta taglibs project ?

860


Is struts mvc framework?

868


What do you mean by action errors and what are the results they force?

997


Explain about logic match tag?

994


Why use struts framework in java?

1027


What is the flow of requests in struts based applications?

930


What is ValueStack and OGNL?

995


What are the ways in which duplicate form submission can occur?

880


What is an interceptor stack?

985