ITeye博客

java

共 6 篇文章

Spring Security , authenticate use LDAP& DataBase.

基础部分参见: http://suene.iteye.com/blog/1829807 <authentication-manager> <authentication-provider ref="authenticationProvider" /> </authentication-manager> <beans:bean id="authenticationProvider" class="org.e.simple.authtication.LdapAndDbAuthenticationProvider"> <beans:property name="authenticateByLdap…

2013-03-18 17:32 · java

搭建 Apache Directory Server

先下载 Apache DS http://directory.apache.org/apacheds/downloads.html 然后下载 Apache Directory Studio http://directory.apache.org/studio/downloads.html 然后使用 Studio 连接 Apache DS,url指向那个机器,端口是 10389 . 下面是默认的样子. 然后右键点击 dc=example,dc=com. 可以创建 Entry ,这样就能构建自己的想要的目录结构了. 创建目录成功后,可以编辑它的属性. 比如用户 uin ,userPassword…

2013-03-18 15:24 · java

Spring Security Embadded LDAP

Reference : http://lengyun3566.iteye.com/blog/1358310 http://www.zytrax.com/books/ldap/ch5/index.html#step1-ldif http://krams915.blogspot.hk/2011/01/spring-security-mvc-using-embedded-ldap.html http://static.springsource.org/spring-security/site/docs/3.2.x/reference/ldap.html pom.xml,这里只写了 LDAP 的部分…

2013-03-15 09:28 · java

Spring Data JPA,基础学习笔记.

http://static.springsource.org/spring-data/data-jpa/docs/current/reference/html/ Spring 配置简述. <jpa:repositories base-package="org.e.test.**.dao" entity-manager-factory-ref="entityManagerFactory" transaction-manager-ref="transactionManager" /> <tx:annotation-driven transaction-manager="transactionMa…

2012-12-28 12:13 · java

Java 获取本机网卡地址.

public static List<String> getAllMacAddresses() { List<String> addresses = new ArrayList<String>(); StringBuffer sb = new StringBuffer(); try { Enumeration<NetworkInterface> networkInterfaces = NetworkInterface.getNetworkInterfaces(); while(networkInterfaces.hasMoreElements()) { NetworkInterface ne…

2012-12-26 17:06 · java

Hibernate4 + ehcache.

开篇先写结论: Hibernate4 想使用 ehcache 时做二级缓存时,不使用 EHCache 提供的: hibernate.cache.region.factory_class 请无视 EHcache 网站上的 document , 那是针对 Hibernate 3.X 的. Hibernate 4.X 有自己对其他 Cache 框架的支持. 具体修改的地方: 1.Hibernate Properties 配置. hibernate.cache.region.factory_class=org.hibernate.cache.ehcache.EhCacheRegionFactory …

2012-12-24 19:40 · java