这章主要讲整合开发,直接从实战讲起,对与ssh的单方面了解,请继续等待我的兴许文章。

解说不到位的地方欢迎大家指正:联系方式rlovep.com

具体请看源码凝视:

全部代码下载(csdn):链接

Github链接:链接https://github.com/wpeace1212/javaBlog/tree/master/sshDemo

写文章不易,欢迎大家採我的文章,以及给出实用的评论。当然大家也能够关注一下我的github。多谢。

1.整合流程

针对一个简单项目。让大家对三层机构和MVC有一个简单的认识,以及如何整合ssh框架;

1.整合的项目介绍:

  1. 企业人事管理系统!要求对员工信息进行维护。
  2. 后台系统先登陆,才干操作员工: 加入/改动/删除
  3. 没有登陆,仅仅能查看列表,不能操作!

2.功能分类:

1. 管理员模块:相应AdminAction中实现

登陆/注冊

2. 员工模块:相应EmployeeAction中实现

加入一个员工, 指定加入的部门

对指定的员工信息改动

删除选择员工

列表展示

3.须要的技术:

1. Struts2:对是否登陆的拦截,对各个功能请求的分别处理。模型驱动。

2. Hibernate4:建立多对一关系的数据库,以及实现增删改查

表t_admin:存放管理员信息

表t_dept:存放部门信息。要用到one-to-many关联员工表

表t_employee:存放员工信息,要用到many-to-one关联部门表

3. Spring:实现bean对象的创建管理。整合,事务管理

4.大体依照以下的流程进行介绍:设计数据库直接在实体存中实现

  1. Jar包引入

  2. entity层映射

  3. Spring配置

  4. hibernate配置

  5. Dao层

  6. Service层

  7. web.xml配置

  8. struts.xml配置

  9. Action层

  10. jsp层

三层架构:当中2。4,5步是数据訪问层。3,6步是业务逻辑层。7,9,10步表现层

MVC:当中2,3,4,5,6步是模型层,7,9,步是控制层。10步是视图层

5.工程简图:

2.Jar包下载

第一步当然是建立web项目、引入jar文件、准备环境了。建立就不介绍了。仅仅介绍最小包的引入:

我的最小包下载地址(ssh最小包):http://download.csdn.net/detail/peace1213/9412092

  • 1.Struts 2.3.16.1

下载地址:http://struts.apache.org/download

Struts中须要引入的包:struts-2.3.16.1/apps/struts2-blank/WEB-INF/lib:该lib以下的包都能够引入;

  • 2.spring-framework-4.2.3.RELEASE-dist.zip

下载地址:http://repo.springsource.org/libs-release-local/org/springframework/spring/

须要引入的包:

  • 3.Hibernate 4.1.6

下载地址:http://sourceforge.net/projects/hibernate/files/hibernate4

须要引入的包:

  • 4.Aopalliance 1.0

该包在struts的lib中有

下载地址:http://sourceforge.net/projects/aopalliance


  1. aopalliance.jar
  • 5.Aspectj 1.7.0

下载地址:http://www.eclipse.org/aspectj/downloads.php


  1. aspectjrt.jar
  2. aspectjweaver.jar
  • 6.Cglib 2.2.3

下载地址:http://sourceforge.net/projects/cglib/files


  1. cglib-2.2.3.jar
  • 7.Asm 3.3

该包在struts的lib中有

下载地址:http://forge.ow2.org/projects/asm


  1. asm-3.3.jar
  • 8.Log4j 1.2.17

该包在struts的lib中有

下载地址:http://logging.apache.org/log4j/1.2/download.html


  1. log4j-1.2.17.jar
  • 9.mysql-connector-java-5.1.37-bin.jar

下载地址:http://dev.mysql.com/downloads/connector/j


  1. mysql-connector-java-5.1.37-bin.jar
  • 10.Commons Logging 1.1.1

该包在struts的lib中有

下载地址:http://commons.apache.org/logging


  1. commons-logging-1.1.1.jar

其它须要引入的jar:

3.entity层映射

1.须要建立三个实体类:Admin.java,Dept.java,Employee.java,例如以下:


  1. 此处都省略getset方法:
  2. public class Admin {
  3. private int id;
  4. private String adminName;
  5. private String pwd;
  6. ......
  7. public class Dept {
  8. private int id;
  9. private String name;
  10. private Set<Employee> emps=new LinkedHashSet<>();
  11. ......
  12. public class Employee {
  13. private int id;
  14. private String empName;
  15. private double salary;
  16. private Dept dept;
  17. ......

2.建立相应的映射文件:×.hbm.xml


  1. 1.Admin.hbm.xml:
  2. <class name="Admin" table="t_admin">
  3. <id name="id">
  4. <generator class="native"></generator>
  5. </id>
  6. <property name="adminName" length="20"></property>
  7. <property name="pwd" length="20"></property>
  8. </class>
  9. 2.Dept.hbm.xml:
  10. <class name="Dept" table="t_dept">
  11. <id name="id" >
  12. <generator class="native"></generator>
  13. </id>
  14. <property name="name" column="Dname"></property>
  15. <set name="emps" cascade="save-update,delete" table="t_employee" >
  16. <key column="dept_id"></key>
  17. <one-to-many class="Employee"></one-to-many>
  18. </set>
  19. 3.Employee.hbm.xml:
  20. <class name="Employee" table="t_employee">
  21. <id name="id">
  22. <generator class="native"></generator>
  23. </id>
  24. <property name="empName" length="20"></property>
  25. <property name="salary" type="double"></property>
  26. <many-to-one name="dept" column="dept_id" class="Dept"></many-to-one>
  27. </class>

4.Spring配置 :

Spring分为:bean-base.xml,bean-dao.xml,bean-service.xml,bean-action.xml,以及整合成一个的bean.xml

辞去临时介绍bean-base.xml基础功能文件和bean.xml。其它文件到相应的介绍地方再进行介绍;

1.bean-base.xml:主要配置Hibernate的工厂sessionFactory和事务。连接池


  1. <?
  2. xml version="1.0" encoding="UTF-8"?>
  3. <beans xmlns="http://www.springframework.org/schema/beans"
  4. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  5. xmlns:p="http://www.springframework.org/schema/p"
  6. xmlns:context="http://www.springframework.org/schema/context"
  7. xmlns:aop="http://www.springframework.org/schema/aop"
  8. xmlns:tx="http://www.springframework.org/schema/tx"
  9. xsi:schemaLocation="http://www.springframework.org/schema/beans
  10. http://www.springframework.org/schema/beans/spring-beans.xsd
  11. http://www.springframework.org/schema/context
  12. http://www.springframework.org/schema/context/spring-context.xsd
  13. http://www.springframework.org/schema/aop
  14. http://www.springframework.org/schema/aop/spring-aop.xsd
  15. http://www.springframework.org/schema/tx
  16. http://www.springframework.org/schema/tx/spring-tx.xsd">
  17. <!-- 1. 数据源对象: C3P0连接池 -->
  18. <bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource">
  19. <property name="driverClass" value="com.mysql.jdbc.Driver"></property>
  20. <property name="jdbcUrl" value="jdbc:mysql://localhost:3306/day01?useUnicode=true&amp;characterEncoding=UTF8"></property>
  21. <property name="user" value="root"></property>
  22. <property name="password" value="123456"></property>
  23. <property name="initialPoolSize" value="3"></property>
  24. <property name="maxPoolSize" value="10"></property>
  25. <property name="maxStatements" value="100"></property>
  26. <property name="acquireIncrement" value="2"></property>
  27. </bean>
  28. <!-- ###########Spring与Hibernate整合 start########### -->
  29. <!-- 【推荐】方式全部的配置全部都在Spring配置文件里完毕 -->
  30. <bean id="sessionFactory"
  31. class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
  32. <!-- 注入连接池对象 -->
  33. <property name="dataSource" ref="dataSource"></property>
  34. <!-- Hibernate经常使用配置 -->
  35. <property name="hibernateProperties">
  36. <props>
  37. <prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>
  38. <prop key="hibernate.show_sql">true</prop>
  39. <prop key="hibernate.hbm2ddl.auto">update</prop>
  40. </props>
  41. </property>
  42. <!-- hibernate映射配置-->
  43. <property name="mappingLocations">
  44. <list>
  45. <value>classpath:com/rlovep/entity/*.hbm.xml</value>
  46. </list>
  47. </property>
  48. </bean>
  49. <!-- ###########Spring与Hibernate整合 end########### -->
  50. <!-- 事务配置 -->
  51. <!-- a. 配置事务管理器类 -->
  52. <bean id="txManager" class="org.springframework.orm.hibernate4.HibernateTransactionManager">
  53. <property name="sessionFactory" ref="sessionFactory"></property>
  54. </bean>
  55. <!-- b. 配置事务增强(拦截到方法后假设管理事务?) -->
  56. <tx:advice id="txAdvice" transaction-manager="txManager">
  57. <tx:attributes>
  58. <tx:method name="*" read-only="false"/>
  59. </tx:attributes>
  60. </tx:advice>
  61. <!-- c. Aop配置 -->
  62. <aop:config>
  63. <aop:pointcut expression="execution(* com.rlovep.service.impl.*.*(..))" id="pt"/>
  64. <aop:advisor advice-ref="txAdvice" pointcut-ref="pt"/>
  65. </aop:config>
  66. <!-- 用于建表 -->
  67. <bean id="appDao" class="com.rlovep.entity.AppDao">
  68. <property name="sessionFactory" ref="sessionFactory"></property>
  69. </bean>
  70. </beans>

2.bean.xml:


  1. ....省略.....
  2. <!-- 引入其它配置文件 -->
  3. <import resource="config/bean-base.xml"/>
  4. <import resource="config/bean-dao.xml"/>
  5. <import resource="config/bean-service.xml"/>
  6. <import resource="config/bean-action.xml"/>
  7. </beans>

5.Hibernate配置:

Spring中已经配置好了Hibernate,此处主要解说建立数据库中的三个表。

  1. 建立AppDao类文件:bean已经在bean.hbm.xml中配置了

  1. /*
  2. * 用来创建数据库中的表
  3. */
  4. public class AppDao {
  5. //工厂通过spring注入
  6. private SessionFactory sessionFactory;
  7. public void setSessionFactory(SessionFactory sessionFactory) {
  8. this.sessionFactory = sessionFactory;
  9. }
  10. //@Test
  11. public void test(){
  12. //sessionFactory=(SessionFactory)ac.getBean("sessionFactory");
  13. Session session = sessionFactory.openSession();
  14. Transaction tx = session.beginTransaction();
  15. //保存管理员,并创建表
  16. Admin admin=new Admin();
  17. admin.setAdminName("admin");
  18. admin.setPwd("123456");
  19. session.save(admin);
  20. //保存部门和雇员。并创建表
  21. Dept dept1=new Dept();
  22. Dept dept2=new Dept();
  23. ....省略.....
  24. //持久化
  25. session.save(dept1);
  26. ....省略.....
  27. session.save(employee4);
  28. tx.commit();
  29. session.close();
  30. }

2.建立类App类创建数据库和存数据:


  1. public class App {
  2. private ApplicationContext ac=new ClassPathXmlApplicationContext("config/bean-base.xml");
  3. @Test
  4. public void test(){
  5. //ac.getBean("deptDao");
  6. AppDao appDao = (AppDao)ac.getBean("appDao");
  7. appDao.test();
  8. }
  9. }

3.点击执行App的test方法就能够完毕数据库的创建。

6.Dao层:实现数据增删改查。

1.先建立接口: IAdminDao,IDepDao。IEmployee,IBaseDao(全部Dao的通用操作接口定义)

此处仅仅贴出IBaseDao接口的定义:


  1. /*
  2. * * 全部dao的通用操作接口定义
  3. */
  4. public interface IBaseDao<T> {
  5. /**
  6. * 保存
  7. * @param obj
  8. */
  9. void save(T obj);
  10. ....省略.....
  11. }

2.接口的实现:AdminDao。DepDao,Employee,BaseDao(全部Dao的通用操作。希望全部的dao都继承此类)

BaseDao实现:


  1. /*
  2. * 全部dao的通用操作,希望全部的dao都继承此类
  3. */
  4. public class BaseDao<T> implements IBaseDao<T>{
  5. //当前操作实际的bean类型
  6. private Class<T>clazz;
  7. //获取类名称
  8. private String className;
  9. // IOC容器(依赖)注入SessionFactory对象
  10. private SessionFactory sessionFactory;
  11. public void setSessionFactory(SessionFactory sessionFactory) {
  12. this.sessionFactory = sessionFactory;
  13. }
  14. public BaseDao() {
  15. Type type=this.getClass().getGenericSuperclass();
  16. //转换为參数化类型
  17. ParameterizedType pt=(ParameterizedType)type;// BaseDao<Employee>
  18. //得到实际类型
  19. Type types[]=pt.getActualTypeArguments();
  20. //获取实际类型
  21. clazz=(Class<T>)types[0];
  22. className = clazz.getSimpleName();//比如:Employee
  23. }
  24. ....省略.....
  25. @Override
  26. public List<T> getAll() {
  27. Query query = sessionFactory.getCurrentSession().createQuery("from "+className);
  28. List<T> list = query.list();
  29. return list;
  30. }
  31. }

其它接口实现:

  1. //仅仅须要继承通用操作,和特点接口即可:这里接口中没有方法,能够加方法
  2. public class DeptDao extends BaseDao<Dept> implements IDepDao{
  3. }

7.Service层:

相同先建立接口再建立类,此处不贴出代码,介绍bean-dao.xml,bean-service.xml的建立,以及对刚刚建立的Dao和service进行測试

1.bean-dao.xml

  1. <!-- dao实例 -->
  2. <bean id="adminDao" class="com.rlovep.dao.impl.AdminDao">
  3. <property name="sessionFactory" ref="sessionFactory"></property>
  4. </bean>
  5. <bean id="deptDao" class="com.rlovep.dao.impl.DeptDao">
  6. <property name="sessionFactory" ref="sessionFactory"></property>
  7. </bean>
  8. <bean id="employeeDao" class="com.rlovep.dao.impl.EmployeeDao">
  9. <property name="sessionFactory" ref="sessionFactory"></property>
  10. </bean>

2.bean-service.xml

  1. <!-- service 实例 -->
  2. <bean id="adminService" class="com.rlovep.service.impl.AdminService">
  3. <property name="adminDao" ref="adminDao"></property>
  4. </bean>
  5. <bean id="deptService" class="com.rlovep.service.impl.DeptService">
  6. <property name="deptDao" ref="deptDao"></property>
  7. </bean>
  8. <bean id="employeeService" class="com.rlovep.service.impl.EmployeeService">
  9. <property name="employeeDao" ref="employeeDao"></property>
  10. </bean>

3.測试刚刚建立的dao和service:

在包service中建立App測试类:

  1. public class App {
  2. //载入spring的配置文件
  3. private ApplicationContext ac=new ClassPathXmlApplicationContext("bean.xml");
  4. //測试Admin的操作
  5. @Test
  6. public void testAdmin(){
  7. //获得bean
  8. IAdminService adminService=(IAdminService)ac.getBean("adminService");
  9. Admin admin=new Admin();
  10. admin.setAdminName("admin");
  11. admin.setPwd("123456");
  12. System.out.println( adminService.login(admin));
  13. }
  14. //測试Dept的操作
  15. @Test
  16. public void testDept(){
  17. IDeptService service=( IDeptService)ac.getBean("deptService");
  18. System.out.println( service.findById(1));
  19. }
  20. //測试Employee的操作
  21. @Test
  22. public void testEmployee(){
  23. IEmployeeService service=( IEmployeeService)ac.getBean("employeeService");
  24. List<Employee> list = service.getAll();
  25. System.out.println( service.findById(9));
  26. }
  27. }

8.web.xml配置:

  1. 须要配置Spring

  2. 须要配置Struts2

  3. 配置文件例如以下:


  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0">
  3. <display-name>sshDemo</display-name>
  4. <!-- 配置spring的OpenSessionInView模式 【目的:JSp页面訪问懒载入数据】 -->
  5. <!-- 注意:訪问struts时候须要带上*.action后缀 -->
  6. <filter>
  7. <filter-name>OpenSessionInView</filter-name>
  8. <filter-class>org.springframework.orm.hibernate4.support.OpenSessionInViewFilter</filter-class>
  9. </filter>
  10. <filter-mapping>
  11. <filter-name>OpenSessionInView</filter-name>
  12. <url-pattern>*.action</url-pattern>
  13. </filter-mapping>
  14. <!-- Struts2的配置 -->
  15. <filter>
  16. <!-- 配置过滤器的名字 -->
  17. <filter-name>struts2</filter-name>
  18. <!-- 配置核心过滤器类 -->
  19. <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
  20. </filter>
  21. <!--配置要拦截的URL,辞去配置全部拦截 -->
  22. <filter-mapping>
  23. <filter-name>struts2</filter-name>
  24. <url-pattern>/*</url-pattern>
  25. </filter-mapping>
  26. <!--在web.xml中加入例如以下代码令server自己主动载入Spring -->
  27. <context-param>
  28. <param-name>contextConfigLocation</param-name>
  29. <param-value>classpath:bean.xml</param-value>
  30. </context-param>
  31. <listener>
  32. <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
  33. </listener>
  34. <!-- 首页配置 -->
  35. <welcome-file-list>
  36. <welcome-file>index.jsp</welcome-file>
  37. </welcome-file-list>
  38. </web-app>

9.struts.xml配置 :

1.因为spring的整合,在 struts.xml配置文件里的class属性直接使用:spring的配置文件bean-action.xml中定义的bean

2.struts.xml文件:


  1. <package name="struts2" extends="struts-default">
  2. <!-- 配置action,class属性使用Spring中定义的bean->
  3. <action name="admin_*" class="adminAction" method="{1}">
  4. <!-- 登陆失败 -->
  5. <result name="loginFaild">/login.jsp</result>
  6. <!-- 登陆成功 -->
  7. <result name="index" type="redirectAction">emp_list</result>
  8. </action>
  9. <action name="emp_*" class="employeeAction" method="{1}">
  10. <!-- 列表展示 -->
  11. <result name="list">/WEB-INF/list.jsp</result>
  12. <!-- 进入加入页面视图 -->
  13. <result name="add">/WEB-INF/add.jsp</result>
  14. <!-- 加入成功,进入列表 (防止刷新就多一条记录问题。所以用重定向) -->
  15. <result name="listAction" type="redirectAction">emp_list</result>
  16. <!-- 进入改动页面 -->
  17. <result name="edit">/WEB-INF/edit.jsp</result>
  18. </action>

3.bean-action.xml文件:


  1. <!-- 指定action多例 -->
  2. <bean id="adminAction" class="com.rlovep.action.AdminAction" scope="prototype">
  3. <property name="adminService" ref="adminService"></property>
  4. </bean>
  5. <bean id="employeeAction" class="com.rlovep.action.EmployeeAction" scope="prototype">
  6. <property name="deptService" ref="deptService"></property>
  7. <property name="employeeService" ref="employeeService"></property>
  8. </bean>

10.Action层 :

  1. 建立AdminAction文件:继承ActionSupport类,和实现ModelDriver接口

  2. 建立EmployeeAction文件:继承ActionSupport类。和实现ModelDriver接口

  3. 建立拦截器类:AdminInterceptor类用于推断是否登陆;继承AbstractInterceptor


  1. @Override
  2. public String intercept(ActionInvocation invocation) throws Exception {
  3. //得到当前执行的方法
  4. String method = invocation.getProxy().getMethod();
  5. //推断:当不为登陆方法和list方法时
  6. if(!"login".equals(method)&&!"list".equals(method)){
  7. Object obj= ActionContext.getContext().getSession().get("adminInfo");
  8. if(obj==null){
  9. //没有登陆
  10. return "login";
  11. }else{
  12. //放行
  13. return invocation.invoke();
  14. }
  15. }
  16. //放行
  17. return invocation.invoke();
  18. }

11.建立相应的jsp文件:

主要有:index,login,edit,add,list等jsp文件;详情见工程源码;

11.測试图:部署动态工程

  1. 測试登陆

  1. 測试加入

  1. 測试删除

  1. 測试改动

好的本章介绍到这里

来自伊豚wpeace(rlovep.com)

从MVC和三层架构说到ssh整合开发-下的更多相关文章

  1. 从MVC和三层架构说到SSH整合开发

    相信很多人都认同JavaWeb开发是遵从MVC开发模式的,遵从三层架构进行开发的,是的,大家都这么认同.但是相信大家都会有过这样一个疑问,if(MVC三层模式==三层架构思想)out.println( ...

  2. 【转】浅谈MVC与三层架构

    首先给大家引入下MVC的概念: MVC(Model View Controller)模型.视图以及控制器,它是一种较为广泛应用的结构设计模式. 模型:就是在MVC设计模式中需要被显示的数据.在通常情况 ...

  3. MVC与三层架构的区别

    我们平时总是将三层架构与MVC混为一谈,殊不知它俩并不是一个概念.下面我来为大家揭晓我所知道的一些真相. 首先,它俩根本不是一个概念. 三层架构是一个分层式的软件体系架构设计,它可适用于任何一个项目. ...

  4. mvc和三层架构到底有什么区别

    原文地址:http://zhidao.baidu.com/question/82001542.html?qbl=relate_question_3&word=MVC%20%CA%FD%BE%D ...

  5. MVC与三层架构

    我们平时总是将三层架构与MVC混为一谈,殊不知它俩并不是一个概念.下面我来为大家揭晓我所知道的一些真相. 首先,它俩根本不是一个概念. 三层架构是一个分层式的软件体系架构设计,它可适用于任何一个项目. ...

  6. MVC和三层架构

    从最开始写程序到现在,一路上听到架构这个词已经无数次了,在工作和圈子里也不停听到大家在讨论它,但是很多时候发现不少人对这个概念的理解都是很模糊的,无意间在知道上看到一个朋友的回答,感觉很不错,特转帖到 ...

  7. jsp&el&jstl mvc和三层架构

    jsp:java在html中插入java 一.JSP技术 1.jsp脚本和注释 jsp脚本:(翻译成servlet,源码位置apache-tomcat-7.0.52\work\Catalina\loc ...

  8. (转)MVC 与三层架构

    原文:https://juejin.im/post/5929259b44d90400642194f3 MVC 与三层架构 一.简述 在软件开发中,MVC与三层架构这两个专业词汇经常耳闻,同时总有很多人 ...

  9. Asp.Net MVC简单三层架构(MVC5+EF6)

    三层架构与MVC的关系 三层架构是一个分层式的软件体系架构设计,分为:表现层(UI).业务逻辑层(BLL).数据访问层(DAL).分层的目的是为了实现“高内聚,低耦合”的思想,有利于系统后期的维护.更 ...

随机推荐

  1. SQL查询中关键词的执行顺序

    写在前面:最近的工作主要是写SQL脚本,在编写过程中对SQL的执行和解析过程特别混乱不清,造成了想优化却无从下手.为此专门在网上找博文学习,并做了如下总结. 1.查询中常用到的关键词有: SELECT ...

  2. 【20181024T1】小C的数组【二分+dp】

    题面 [正解] 题目求最大的最小,可以二分 设\(f_i\)表示第i个数不改满足条件需要改多少个 可以从j转移,那么[j+1,i]的均匀摊开后的差值应该在范围内 容易推出方程: \(f_i=min_{ ...

  3. 防止xss攻击

    <?php function _removeXSS($val) { $search = 'abcdefghijklmnopqrstuvwxyz'; $search .= 'ABCDEFGHIJK ...

  4. iOS 常用工具库LFKit功能介绍

    简介:LFKit包含了平时常用的category,封装的常用组件,一些工具类. 需要LFKit中所有自定义控件的pod 'LFKit/Component' 需要LFKit中所有category的pod ...

  5. [典型漏洞分享]一个典型的软件漏洞--memcpy导致的缓冲区溢出

    YS VTM模块存在缓冲区溢出漏洞,可导致VTM进程异常退出[高] 问题描述: YS VTM模块开放对外监听端口(8554和8664),并从外部接收网络数据,中间模块调用到memcpy函数对网络数据进 ...

  6. ArcGIS 10.2 三维分析工具箱部分工具不能用

    如在以下面的方式操作时发现弹出错误提示, “ Unable to execute the selected tool”... 问题解决方法为: 点击Extensions...,然后把下图中的选项全部勾 ...

  7. CSS -- 文字竖直居中

    元素的height 和 lineheight 设置为一样即可.

  8. jquery children()方法

    1.测试代码 <!DOCTYPE html> <html> <head> <script type="text/javascript" s ...

  9. Openshift部署Zookeeper和Kafka

    部署Zookeeper github网址 https://github.com/ericnie2015/zookeeper-k8s-openshift 1.在openshift目录中,首先构建imag ...

  10. 万里长征第二步——django个人博客(第二步 ——日志记录器)

    定义日志记录器 可以在setting.py里设置日志记录器 # 自定义日志输出信息 LOGGING = { 'version': 1, 'disable_existing_loggers': True ...