利用EXTJS来显示LDAP的树状结构
2009-09-17 00:00:00 来源:WEB开发网Ldapconnect.java代码
public List getList(String path) {
DistinguishedName dn = null;
if ("".equals(path) || path ==null)
dn = new DistinguishedName();
else
dn = new DistinguishedName(path);
return ldapTemplate.list(dn);
}
Applicationcontext.xml代码
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
<bean id="ldapSource" class="org.springframework.ldap.core.support.LdapContextSource">
<property name="url" value="ldap://localhost:389" />
<property name="base" value="DC=cz8,DC=net" />
<property name="userDn" value="cn=manager,DC=cz8,DC=net" />
<property name="password" value="password" />
</bean>
<bean id="ldapTemplate" class="org.springframework.ldap.core.LdapTemplate">
<constructor-arg ref="ldapSource" />
</bean>
<bean id="userDao" class="ldap.connect.LdapConnect">
<property name="ldapTemplate"><ref bean="ldapTemplate"/></property>
</bean>
</beans>
HTML页面
Index.html代码
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Example</title>
<link rel="stylesheet" type="text/css" href="ext-2.3.0/resources/css/ext-all.css" />
<script type="text/javascript" src="ext-2.3.0/adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="ext-2.3.0/ext-all.js"></script>
<script type="text/javascript" src="ext-2.3.0/ext-lang-zh_CN.js"></script>
<script type="text/javascript" src="operate.js"></script>
</head>
<body>
<div id="layout"></div>
</body>
</html>
更多精彩
赞助商链接