1. There's a "Code" button on our message editor. If you use that to generate tags around pre-formatted text such as Java code and XML, it's a lot easier for us to read.
2. Look back about a week or so in this forum. This question has been popular recently.
3. There's nothing really special about doing this kind of request in Tomcat. You'd set up the same sort of LDAP query, Tomcat or not. So you might want to ask how to do queries like this in our LDAP forum.
An IDE is no substitute for an Intelligent Developer.