Posted By:
Thomas_Valletta
Posted On:
Thursday, August 9, 2001 10:37 AM
I have used the following code to create a sorted set of results. Your context variable would be the context you wish to list (eg. "o=kumar").
LdapContext ctx = new InitialLdapContext(env, null);
Control[] ctxControls = new Control[]{
new SortControl(new String[]{"cn"}, Control.CRITICAL);
};
ctx.setRequestControls(ctxControls);
NamingEnumeration results = ctx.list(context);