O'Reilly logo

MySQL™ and JSP™ Web Applications: Data-Driven Programming Using Tomcat and MySQL by James Turner

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Testing LDAP Reading

After building and compiling the Employee bean, you can test it with some standalone JSP pages. To begin, see if you can read employee records out of the database (see Listing 15.4).

The test program takes an employee user ID as an argument and then uses the findEmployee method to look it up in LDAP. If an employee is found and returned, the code displays various pieces of information about that person (see Figure 15.5); otherwise it prints an error message.

Figure 15.5. Running testLdapRead.jsp.

Listing 15.4. testLdapRead.jsp
 <%@ page import="com.bfg.employee.Employee" %> <HEAD><TITLE>Look for employee test</TITLE></HEAD><BODY> ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required