Java Reference
In-Depth Information
}
catch
(Exception e){ lastError
#
e.getMessage(); }
return
folder;
}
// close the connection with the POP server
public void
closePopServer() {
try
{
folder.close(
true
);
pop.close();
}
catch
(Exception e){ }
folder
#
null
;
pop
#
null
;
}
// return the last error message
public
String getError(){
return
lastError; }
// getters
public
String userName(){
return
username; }
public
String firstName(){
return
firstname; }
public
String lastName(){
return
lastname; }
public
String popServer(){
return
popserver; }
public
String popUser(){
return
popuser; }
public
String popPass(){
return
poppass; }
// setters
public
void setPass(String newValue){ pass
#
newValue; }
public
void setFirstName(String newValue)
{ firstname
#
newValue; }
public
void setLastName(String newValue)
{ lastname
#
newValue; }
public
void setPopServer(String newValue)
{ popserver
#
newValue; }
public
void setPopUser(String newValue)
{ popuser
#
newValue; }
public
void setPopPass(String newValue)
{ poppass
#
newValue; }
}
Class
ContextListener
implements the
ServletContextListener
interface.
This class is registered with the JSP container and is invoked whenever the
application context is created or destroyed.
import
UbiMail.*;
import
javax.naming.InitialContext;
import
javax.sql.*;
import
java.sql.*;
import
javax.servlet.*;
import
java.io.IOException;
public final class
ContextListener
implements
ServletContextListener {