Java JSP Application Hosting Web Hosting, website hosting, web site hosting , web page hosting Apache, PHP, MySQL, PERL, servlets Java, JSP  Java JSP Application Hosting Web Hosting website hosting, web site hosting, web page hosting Apache, PHP, MySQL, PERL, servlets Java, JSP,Python Java JSP Application Hosting Web Hosting website hosting, web site hosting, web page hosting Apache, PHP, MySQL, PERL, servlets Java, JSP,Python Java JSP Application Hosting Web Hosting website hosting, web site hosting, web page hosting Apache, PHP, MySQL, PERL, servlets Java, JSP,Python Java JSP Application Hosting Web Hosting website hosting, web site hosting, web page hosting, Apache, PHP, MySQL, PERL, servlets Java, JSP,Python
Java JSP Application Hosting Web Hosting, website hosting, web site hosting, web page hosting, Apache, PHP, MySQL, PERL, servlets Java, JSP, Python Java JSP Application Hosting Web Hosting, website hosting, web site hosting, web page hosting, Apache, PHP, MySQL, PERL, servlets Java, Python,JSP
Java JSP Application Hosting Web Hosting Sign-Up Java JSP Application Hosting Fund Raising, Fundraising, web hosting, website hosting, web site hosting  Java JSP Application Hosting Resellers web hosting, website hosting, web site hosting Java JSP Application Hosting EZ Site Control Panel for web hosting,website hosting, web site hosting
Java JSP Application Hosting Web Hosting, website hosting, web site hosting , web page hosting Apache, PHP, MySQL, PERL, servlets Java, Python,JSP,  Fundraising
Java JSP Application Hosting Fund Raising, Fundraising, web hosting, website hosting, web site hosting
WWW.

Call Us Toll-Free
(877) 256-0328

Outside USA
1 - (201) 505-0430

Java JSP Application Hosting Welcome Java JSP Application Hosting Web Hosting Plans Overview , Fund Raising, Fundraising, web hosting, website hosting, web site hosting Java JSP Application Hosting Fund Raising, Fundraising, web hosting Java JSP Application Hosting Resellers, web Hosting Java JSP Application Hosting Web Design, web Hosting Java JSP Application Hosting Extra Services,  web Hosting Java JSP Application Hosting Traffic Booster, web hosting Java JSP Application Hosting Traffic Booster, web hosting Java JSP Application Hosting Technical Support,  web Hosting Java JSP Application Hosting webmaster tips,  web Hosting Java JSP Application Hosting 30 Day Money Back, web hosting Java JSP Application Hosting Legal Notices for Web Hosting Java JSP Application Hosting Glossary Computer Terms for web Hosting Java JSP Application Hosting Contact Information - web hosting

Site Map
Java JSP Application Hosting Web Hosting, website hosting, web site hosting , web page hosting Apache, PHP, MySQL, PERL, servlets Java, Python, JSP Java JSP Application Hosting Java JSP Application Hosting Java JSP Application Hosting Java JSP Application Hosting Java JSP Application Hosting Paged Results Control (The Java™ Tutorials > Java Naming and Directory Interface(TM). > New features in JDK 5.0 and JDK 6)
Trail: Java Naming and Directory Interface(TM).
Lesson: New features in JDK 5.0 and JDK 6
Home Page > Java Naming and Directory Interface(TM). > New features in JDK 5.0 and JDK 6
Paged Results Control

BasicControl

The javax.naming.ldap.BasicControl which implements the javax.naming.ldap.Control serves as a base implementation for extending other controls.

Paged Results Control

The paged results control is useful for LDAP clients which want to receive search results in a controlled manner limited by the page size. The page size can be configured by the client as per the availability of its resources, like bandwidth and the processing capability.

The server uses a cookie (similar to the HTTP session cookie mechanism) to maintain the state of the search requests in order to track the results being sent to the client. The paged results control is specified in RFC 2696. The classes below provide the functionality required to support paged results control.

How to use Paged Results Control?
The example below illustrates the client-server interaction between a client doing a search requesting a page size limit of 5. The entire result set returned by the server contains 21 entries.
  1. Client sends a search request asking for paged results with a page size of 5.
       
        // Activate paged results
         int pageSize = 5; // 5 entries per page
         byte[] cookie = null;
         int total;
         ctx.setRequestControls(new Control[]{ 
             new PagedResultsControl(pageSize, Control.CRITICAL) });
         // Perform the search
         NamingEnumeration results =
             ctx.search("", "(objectclass=*)", new SearchControls());
        
        
  2. The server responds with entries plus an indication of 21 total entries in the search result and an opaque cookie to be used by the client when retrieving subsequent pages.
       
       // Iterate over a batch of search results sent by the server
             while (results != null && results.hasMore()) {
                 // Display an entry
                 SearchResult entry = (SearchResult)results.next();
                 System.out.println(entry.getName());
    
                 // Handle the entry's response controls (if any)
                 if (entry instanceof HasControls) {
                     // ((HasControls)entry).getControls();
                 }
             }
       // Examine the paged results control response 
             Control[] controls = ctx.getResponseControls();
             if (controls != null) {
                 for (int i = 0; i < controls.length; i++) {
                     if (controls[i] instanceof PagedResultsResponseControl) {
                         PagedResultsResponseControl prrc =
                             (PagedResultsResponseControl)controls[i];
                         total = prrc.getResultSize();
                         cookie = prrc.getCookie();
                     } else {
                         // Handle other response controls (if any)
                     }
                 }
             }   
        
        
  3. Client sends an identical search request, returning the opaque cookie, asking for the next page.
       
      // Re-activate paged results
             ctx.setRequestControls(new Control[]{
                 new PagedResultsControl(pageSize, cookie, Control.CRITICAL) });
       
       
  4. Server responds with five entries plus an indication that there are more entries The client repeats the search performed in step 4 until a null cookie is returned by the server, which indicates no more entries to be sent by the server.

The complete JNDI example can be found here.


Note: The Paged Search Control is supported by the Windows Active Directory Server. It's not supported by the Sun Java Directory Server version 5.2
Previous page: Standard LDAP Controls
Next page: Sort Control
 
 
 

Add to My Yahoo!

XML icon

Add to Google

 

 

 

 

 

 

 

 

 

 

 

JSP Servlets Tomcat mysql Java JSP Servlets Tomcat mysql Java JSP Servlets Tomcat mysql Java JSP Servlets Tomcat mysql Java JSP at JSP.aldenWEBhosting.com Servlets at servlets.aldenWEBhosting.com Tomcat at Tomcat.aldenWEBhosting.com mysql at mysql.aldenWEBhosting.com Java at Java.aldenWEBhosting.com Web Hosts Portal Web Links Web Links Web Hosting JSP Solutions Web Links JSP Solutions Web Hosting Servlets Solutions Web Links Servlets Solutions Web Hosting Web Links Web Links . . .
.
.
. .
.
. .
. . . . . . . . . . . jsp hosting servlets hosting web hosting web sites designed cheap web hosting web site hosting myspace web hosting