Announcement Announcement Module
Collapse
No announcement yet.
Format your posts with [code] Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Format your posts with [code]

    People,

    By surrounding your source code, stack traces, or configuration with [code][/code] tags, your posts become much easier to read. Lines don't get broken and spaces aren't randomly added. See the available tags here.

    Compare this:

    Code:
    public void testLookup() throws Exception {
       LdapContextSource source = new LdapContextSource();
       source.setUrl("ldap://somehost");
       source.setBase("dc=example,dc=com");
       source.setUserName("manager");
       source.setPassword("somepassword");
       source.setDirObjectFactory(DefaultDirObjectFactory.class);
       source.setContextFactory(com.sun.jndi.ldap.LdapCtxFactory.class);
       source.setPooled(false);
    
       LdapTemplate template = new LdapTemplate(source);
    
       PersonContextMapper mapper = new PersonContextMapper();
       Object result = template.lookup("uid=admin,ou=Users", mapper);
       assertNotNull(result);
       System.out.println(result);
    }
    with this:

    public void testLookup() throws Exception {

    LdapContextSource source = new LdapContextSource();
    source.setUrl("ldap://somehost");
    source.setBase("dc=example,dc=com");
    source.setUserName("manager");
    source.setPassword("somepassword");
    source.setDirObjectFactory(DefaultDirObjectFactory .class);
    source.setContextFactory(com.sun.jndi.ldap.LdapCtx Factory.class);
    source.setPooled(false);

    LdapTemplate template = new LdapTemplate(source);

    PersonContextMapper mapper = new PersonContextMapper();
    Object result = template.lookup("uid=admin,ou=Users", mapper);
    assertNotNull(result);
    System.out.println(result);
    }

  • #2
    , I'm glad I'm not the only one who feels like this. I seem to say it that often, people have told me to put this as my signature.

    Comment

    Working...
    X