Testing LDAP Creation
Now you can try a JSP to test LDAP record creation (see Listing 15.5). Model this page after the form-submission pages that you've written to this point. A couple of refinements have been added to make the code a bit more straightforward, mainly in the form of notNull and bn (blanks from nulls) helper functions defined at the top. When the page is first requested (or if all the values aren't filled out), it displays a form with all the employee fields (see Figure 15.6). When all the fields are filled out correctly, it uses LDAP to create the record and to display the uid that was assigned (see Figure 15.7).
Figure 15.6. testLdapCreate.jsp requesting values.
Figure 15.7. testLdapCreate.jsp creating a user.
You have to explicitly ...
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.