Trying Out LDAP Modification

Writing a JSP to modify employee information is very similar to creating employee records (see Listing 15.6), although it saves a bit of time by having the form submit back to itself. On this page, the uid to modify is handed in as an argument (presumably from another page with a pull-down or fill-in-the-blank input field). The page checks to see if the employee requested exists; if not, it generates an error.

Listing 15.6. testLdapModify.jsp
 <%@ page import="com.bfg.employee.Employee" %> <HEAD><TITLE>Modify employee</TITLE></HEAD><BODY> <%! private boolean notNull(String str) { return ((str != null) && (str.length() > 0)); } private String bn (String val) { if (val == null) return ""; return val; } %> <% Employee ...

Get MySQL™ and JSP™ Web Applications: Data-Driven Programming Using Tomcat and MySQL now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.