当前位置: 首页 > news >正文

网址导航类网站如何做推广广州手机软件开发

网址导航类网站如何做推广,广州手机软件开发,是怎么回事儿,惠普电脑网站建设策划方案目录 1.spring-ldap的pom依赖2.ldapTemplate的生成--方式1自动注入 2.1 spring-ldap声明2.2 ldapTemplate bean2.3 使用 3.ldapTemplate的生成--方式2代码生成4.spring-ldap的使用 正文 之前学习过spring-ldap的官方文档#xff1a;2017.4.10 spring-ldap官方文档学习 现在是对… 目录 1.spring-ldap的pom依赖2.ldapTemplate的生成--方式1自动注入 2.1 spring-ldap声明2.2 ldapTemplate bean2.3 使用 3.ldapTemplate的生成--方式2代码生成4.spring-ldap的使用 正文 之前学习过spring-ldap的官方文档2017.4.10 spring-ldap官方文档学习 现在是对实际使用的spring-ldap及使用过程中遇到的问题进行总结。 回到顶部 1.spring-ldap的pom依赖 !-- 添加Spring-ldap--dependencygroupIdorg.springframework.ldap/groupIdartifactIdspring-ldap-core/artifactIdversion2.3.1.RELEASE/version/dependency 下面的网址是spring的ldap页里面有一个quick start。其中显示了spring-ldap最近的版本并且勾选不同的版本会自动生成依赖。 http://projects.spring.io/spring-ldap/ 回到顶部 2.ldapTemplate的生成--方式1自动注入 2.1 spring-ldap声明 beans xmlnshttp://www.springframework.org/schema/beans xmlns:xsihttp://www.w3.org/2001/XMLSchema-instance xmlns:ldaphttp://www.springframework.org/schema/ldap xsi:schemaLocationhttp://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsdhttp://www.springframework.org/schema/ldap http://www.springframework.org/schema/ldap/spring-ldap.xsd 2.2 ldapTemplate bean context:property-placeholder locationclasspath:/ldap.properties /ldap:context-source idcontextSource password${sample.ldap.password} url${sample.ldap.url} username${sample.ldap.userDn} base${sample.ldap.base} /ldap:ldap-template idldapTemplate context-source-refcontextSource/ 或者 bean idcontextSource classorg.springframework.ldap.core.support.LdapContextSource property nameurl value${sample.ldap.url} / property namebase value${sample.ldap.base} / property nameuserDn value${sample.ldap.userDn} / property namepassword value${sample.ldap.password} / /bean bean idldapTemplate classorg.springframework.ldap.core.LdapTemplate constructor-arg refcontextSource / /bean 2.3 使用 Autowiredprivate LdapTemplate ldapTemplate 回到顶部 3.ldapTemplate的生成--方式2代码生成 public LdapTemplate getLdapTemplate(){LdapTemplate template null;try {LdapContextSource contextSource new LdapContextSource();contextSource.setUrl(getSync_ldap_url());contextSource.setBase(getSync_ldap_base());contextSource.setUserDn(getSync_ldap_userDn());contextSource.setPassword(getSync_ldap_password());contextSource.setPooled(false);contextSource.afterPropertiesSet(); // importanttemplate new LdapTemplate(contextSource);}catch (Exception e){e.printStackTrace();}return template;} 回到顶部 4.spring-ldap的使用 api的使用在上次的文档中已经学习过了2017.4.10 spring-ldap官方文档学习 一些简单示例 /*** 动态创建dn* param user* return*/private Name buildDn(User user) {return LdapNameBuilder.newInstance().add(ou, Users).add(uid,user.getFdUserid().toString()).build();}/*** 在ldap里更新用户* param user*/private void updateUser(User user) {Name dn buildDn(user);getLdapTemplate().rebind(dn, null, buildAttributes(user));}/*** 在ldap里删除用户* param user*/private void deleteUser(User user) {Name dn buildDn(user);getLdapTemplate().unbind(dn);}/*** 在ldap里创建用户* param user*/private void createUser(User user) {Name dn buildDn(user);getLdapTemplate().bind(dn, null, buildAttributes(user));}/*** 动态构建属性* param user* return*/private Attributes buildAttributes(User user) {Attributes attrs new BasicAttributes();try {BasicAttribute objectclass new BasicAttribute(objectclass);objectclass.add(top);objectclass.add(posixAccount);objectclass.add(inetOrgPerson);attrs.put(objectclass);attrs.put(userPassword, user.getFdLdapPassword() null ? : user.getFdLdapPassword());attrs.put(cn, user.getFdUsername() user.getFdTenantName());attrs.put(sn, user.getFdUsername() user.getFdTenantName());attrs.put(displayName, user.getFdDisplayName() null? :user.getFdDisplayName());attrs.put(homeDirectory, /root);attrs.put(uidNumber, 0);attrs.put(uid, user.getFdUserid().toString());attrs.put(gidNumber, 0);}catch (Exception e){e.printStackTrace();}return attrs;}
http://www.hkea.cn/news/14408672/

相关文章:

  • 广州力科网站建设公司wordpress系统怎样下载
  • 汶上网站建设多少钱专业网站制作公司教程
  • 网站怎么收费网站开发自适应不同分辨率
  • 笔记本做系统哪个网站好无锡建站方案
  • 给别人做的网站要复杂做安全扫描ci和vi设计的区别
  • 邢台网站建设平台学校网站信息化建设工作心得
  • 北京市建设中心网站wordpress主题改中文版
  • 淘宝网页版下载免费网站分析seo报告是坑吗
  • 国内网站为什么要备案国外设计教程网站
  • 网站关键词seo推广公司哪家好网站做的好看术语
  • 51电子网网络优化的基本流程
  • 三网合一网站开发python django做的网站
  • 建设银行长春网站宁波做网站的
  • 淮南正规建设网站品牌青海省建设厅建管处网站
  • wordpress建的手机网站专业的顺的网站建设
  • 网站推广工具网络淘宝上网站开发
  • 商标图案大全网站推广seo优化
  • 开网站做代发和coser做网站
  • 移动网站开发服务如何向alexa提交网站
  • 百度关键词网站怎么做做的网站没有手机版
  • 网站建设 响应式 北京开创网站要怎么做
  • 黑龙江省建设教育网站查询网站建设行业细分
  • h5可以用什么网站做网站申请备案成功后怎么建设
  • 网站怎么在百度做推广电子科技公司网站
  • 昆明做网站的旅行社nas搭建网站
  • 建立企业网站收费标准阿里云的网站建设方案
  • 如何做网站卖商品的网站林业门户网站建设
  • 乐山建设企业网站在线做效果图有哪些网站有哪些
  • 网站绑定微信账号开发一个app需要多少资金
  • 青岛网站制作方法联想企业网盘