Displaying jpegPhoto attribute from LDAP in Websphere Portal -
i have requirement wherein need display details of users after searching ldap using puma api.
i'm having troubling displaying jpegphoto of user.
here's i'm doing: first i'm querying user using: pumalocator.findusersbyattribute(uid, user);
after user list object. each user, fetch attributes in form of map.
i'm getting following value while retrieving jpegphoto:
map.get("jpegphoto") --> [b@7a2f8a54
it seems puma api returns binary string. know how display in portlet?
any appreciated. thank
i think more byte[]
array string.
you can base64 encode binary encoded string , use in html image tag.
byte[] photobytes = (byte[]) map.get("jpegphoto"); string encodedphoto = org.apache.commons.codec.binary.base64.encodebase64(photobytes);
then later, perhaps in jsp (example assumes jstl variable in scope named encodedphoto
):
<img src="data:image/jpeg;base64,${encodedphoto}"/>
Comments
Post a Comment