Java Reference
In-Depth Information
L
ISTING
21.8
Continued
import javax.servlet.ServletContext;
import LDAPManager;
public class LDAPDelete implements Service {
/** Creates new LDAPDelete */
public LDAPDelete() {
}
/**
* Single method to become a service.
*
* @throws Exception if any exceptions need to be thrown back
* to the calling Controller.
*/
public void execute(HttpServletRequest request,
HttpServletResponse response,
ServletContext context) throws Exception {
// Get the dn off of the request
String dn = request.getParameter(“dn”);
// create and initialize an LDAPManager
LDAPManager lm = new LDAPManager();
// Remove the Person from the Server
lm.remove(dn);
}
}
Using the LDAP Application
Next you will use the
ldap
Web application. Make sure you have completed the following
steps:
1.
Created the
ldap
web application
2.
Made sure that the Netscape Directory Server is configured according to Chapter 11
3.
Moved all JSPs to the
<SERVER_ROOT>/webapps/ldap/
directory