directory-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Neha Rawat <nneharaw...@gmail.com>
Subject Re: Getting a Sorted result by setting SortControl
Date Mon, 10 Nov 2014 04:52:10 GMT
No,
skis[0] = new javax.naming.ldap.SortKey(sortKey,false,null);    too does
not work.

I hope the other params are correct. I thought attrID is equivalent to
attribute name and passed "cn" as the 1st argument to SortKey.


Thanks
Neha

On Mon, Nov 10, 2014 at 10:11 AM, Emmanuel Lécharny <elecharny@gmail.com>
wrote:

> Le 10/11/14 05:26, Neha Rawat a écrit :
> > With JNDI, I defined the sortKey like this --
> >             String sortKey = "cn";
> >             javax.naming.ldap.SortKey[] skis = new
> > javax.naming.ldap.SortKey[1];
> >             skis[0] = new javax.naming.ldap.SortKey(sortKey,true,null);
> >             SortControl sortControl = new SortControl(skis,
> > Control.CRITICAL);
> >             ctx.setRequestControls(new Control[] { sortControl });
> >
> > But I get the same exception in this case too.
>
> I'm afraid JNDI is just sending a Control omitting the reverseOrder flag
> when it's set to false (this is teh default value, so you can omit it).
>
> Does it work when you set use this code ? :
>
>             String sortKey = "cn";
>             javax.naming.ldap.SortKey[] skis = new
> javax.naming.ldap.SortKey[1];
>             skis[0] = new javax.naming.ldap.SortKey(sortKey,false,null);
>   // This time, use the reverse order
>             SortControl sortControl = new SortControl(skis,
> Control.CRITICAL);
>             ctx.setRequestControls(new Control[] { sortControl });
>
>
> Thanks !
>
>


-- 
Love and Luck,
Neha

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message