SSH 基本配置--OA系统的经典配置

说明:

此SSH架构时OA系统的经典配置

绝对是最经典的配置,您值得拥有

一、structs配置文件

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts PUBLIC
    "-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"
    "http://struts.apache.org/dtds/struts-2.3.dtd">

<struts>
    <constant name="struts.devMode" value="true" />
    <!-- 全局国际化配置 -->
    <constant name="struts.custom.i18n.resources" value="messages"></constant>
    <constant name="struts.action.extension" value="action,do"/>
    <constant name="struts.configuration.xml.reload" value="true"></constant>
    <constant name="struts.multipart.maxSize" value="10240000"></constant>
    <!-- 表示Action由Spring来进行创建,可以直接使用Spring依赖注入来注入 -->
    <constant name="struts.objectFactory" value="org.apache.struts2.spring.StrutsSpringObjectFactory" />
    <constant name="struts.ui.theme" value="simple"></constant>
    <!-- 允许使用静态方法 -->
    <constant name="struts.ognl.allowStaticMethodAccess" value="true"></constant>  

    <package name="default" namespace="/" extends="json-default">
        <interceptors>
            <interceptor name="privilegeInterceptor" class="com.ssh.oa.filter.PrivilegeInteceptor"></interceptor>
            <interceptor-stack name="defaultStack">
                <interceptor-ref name="privilegeInterceptor"></interceptor-ref>
                <interceptor-ref name="defaultStack"></interceptor-ref>
            </interceptor-stack>
        </interceptors>
        <global-results>
            <result name="error">/WEB-INF/jsp/inc/error.jsp</result>
            <result name="exception">/WEB-INF/jsp/inc/exception.jsp</result>
            <result name="noPrivilege">/WEB-INF/jsp/inc/noPrivilege.jsp</result>
            <result name="loginUI">/WEB-INF/jsp/user/loginUI.jsp</result>
        </global-results>
        <global-exception-mappings>
            <exception-mapping result="exception" exception="com.ssh.document.exeception.MyExeception"></exception-mapping>
        </global-exception-mappings>
        <!-- 跟方法名不相同的都必须写 -->
        <action name="*_*" class="{1}Action" method="{2}">
            <result name="{2}">/WEB-INF/jsp/{1}/{2}.jsp</result>
            <result name="saveUI">/WEB-INF/jsp/{1}/saveUI.jsp</result>
            <result name="toList" type="redirectAction">{1}_list?parentId=${parentId}</result>
            <result name="loginUI">/WEB-INF/jsp/{1}/loginUI.jsp</result>
            <result name="logout">/WEB-INF/jsp/{1}/logout.jsp</result>
            <result name="toIndex" type="redirect">/index.jsp</result>
            <result name="toTopicShow" type="redirectAction">topic_show?id=${topicId}</result>
            <result name="toShow" type="redirectAction">{1}_show?id=${id}</result>
            <result name="downloadProcessImage" type="stream">
                <param name="contentType">image/png</param>
                <param name="inputName">inputStream</param>
            </result>
            <result name="download" type="stream">
                <param name="contentType">application/octet-stream</param>
                <param name="inputName">inputStream</param>
                <param name="contentDisposition">attachment;fileName="${#fileName}</param>
            </result>           

            <result name="toMyApplicationList" type="redirectAction">{1}_myApplicationList</result>
            <result name="toMyTaskList" type="redirectAction">{1}_myTaskList</result>
        </action>

    </package>

</struts>

二、applicationContext.xml配置文件

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
    xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
    xsi:schemaLocation="http://www.springframework.org/schema/beans
    http://www.springframework.org/schema/beans/spring-beans.xsd
    http://www.springframework.org/schema/context
    http://www.springframework.org/schema/context/spring-context.xsd
    http://www.springframework.org/schema/aop
    http://www.springframework.org/schema/aop/spring-aop.xsd
    http://www.springframework.org/schema/tx
    http://www.springframework.org/schema/tx/spring-tx.xsd">
    <!-- 配置 自动代理 -->
    <aop:aspectj-autoproxy />
    <context:annotation-config />
    <context:component-scan base-package="com.ssh.oa.*"></context:component-scan>
    <!-- <aop:aspectj-autoproxy proxy-target-class="true"/> -->

    <!-- 引入外部 properties 文件 -->
    <context:property-placeholder location="classpath:jdbc.properties" />

    <!-- 数据库连接池 -->
    <bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource">
        <property name="driverClass" value="${jdbc.driver}"></property>
        <property name="jdbcUrl" value="${jdbc.url}"></property>
        <property name="user" value="${jdbc.user}"></property>
        <property name="password" value="${jdbc.password}"></property>

        <!-- 其他配置 -->
        <!--初始化时获取三个连接,取值应在minPoolSize与maxPoolSize之间。Default: 3 -->
        <property name="initialPoolSize" value="3"></property>
        <!--连接池中保留的最小连接数。Default: 3 -->
        <property name="minPoolSize" value="3"></property>
        <!--连接池中保留的最大连接数。Default: 15 -->
        <property name="maxPoolSize" value="5"></property>
        <!--当连接池中的连接耗尽的时候c3p0一次同时获取的连接数。Default: 3 -->
        <property name="acquireIncrement" value="3"></property>
        <!-- 控制数据源内加载的PreparedStatements数量。如果maxStatements与maxStatementsPerConnection均为0,则缓存被关闭。Default:
            0 -->
        <property name="maxStatements" value="8"></property>
        <!--maxStatementsPerConnection定义了连接池内单个连接所拥有的最大缓存statements数。Default: 0 -->
        <property name="maxStatementsPerConnection" value="5"></property>
        <!--最大空闲时间,1800秒内未使用则连接被丢弃。若为0则永不丢弃。Default: 0 -->
        <property name="maxIdleTime" value="1800"></property>
    </bean>

    <!-- <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"> -->
    <bean id="sessionFactory"
        class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
        <!-- 引用数据库连接池 -->
        <property name="dataSource" ref="dataSource"></property>
        <!-- 配置hibernate其它属性 -->
        <property name="hibernateProperties">
            <props>
                <prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>
                <prop key="hibernate.show_sql">false</prop>
                <prop key="hibernate.format_sql">false</prop>
                <prop key="hibernate.hbm2ddl.auto">update</prop>
                <prop key="hibernate.connection.autocommit">true</prop>
            </props>
        </property>
        <!-- 引用hbm 映射文件 -->
        <property name="mappingDirectoryLocations">
            <list>
                <value>classpath:com/ssh/oa/domain</value>
            </list>
        </property>
        <property name="mappingLocations">
            <list>
                <value>classpath:jbpm.execution.hbm.xml</value>
                <value>classpath:jbpm.history.hbm.xml</value>
                <value>classpath:jbpm.identity.hbm.xml</value>
                <value>classpath:jbpm.repository.hbm.xml</value>
                <value>classpath:jbpm.task.hbm.xml</value>
            </list>
        </property>
        <!-- <property name="packagesToScan"> <value>com.ssh.document.domain</value>
            </property> -->
    </bean>

    <!-- 事务管理器 -->
    <bean id="transactionManager"
        class="org.springframework.orm.hibernate3.HibernateTransactionManager">
        <property name="sessionFactory" ref="sessionFactory"></property>
    </bean>

    <tx:annotation-driven transaction-manager="transactionManager" />

    <!-- 配置哪些方法要加入事务控制 -->
    <tx:advice id="txAdvice" transaction-manager="transactionManager">
        <tx:attributes>
            <!-- 让所有的方法都加入事务管理,为了提高效率,可以把一些查询之类的方法设置为只读的事务 -->
            <tx:method name="*" propagation="REQUIRED" read-only="true" />
            <!-- 以下方法都是可能设计修改的方法,就无法设置为只读 -->
            <tx:method name="add*" propagation="REQUIRED" />
            <tx:method name="del*" propagation="REQUIRED" />
            <tx:method name="delete*" propagation="REQUIRED" />
            <tx:method name="update*" propagation="REQUIRED" />
            <tx:method name="edit*" propagation="REQUIRED" />
            <tx:method name="set*" propagation="REQUIRED" />
            <tx:method name="save*" propagation="REQUIRED" />
            <tx:method name="move*" propagation="REQUIRED" />
        </tx:attributes>
    </tx:advice>

    <!-- 配置AOP,Spring是通过AOP来进行事务管理的 -->
    <aop:config>
        <!-- 设置pointCut表示哪些方法要加入事务处理 -->
        <!-- 以下的事务是声明在DAO中,但是通常都会在Service来处理多个业务对象逻辑的关系,注入删除,更新等,此时如果在执行了一个步骤之后抛出异常
            就会导致数据不完整,所以事务不应该在DAO层处理,而应该在service,这也就是Spring所提供的一个非常方便的工具,声明式事务 -->
        <aop:pointcut id="allMethods"
            expression="execution(* com.ssh.oa.base.*.*(..)) or execution(* com.ssh.oa.service..*.*(..))" />
        <!-- 通过advisor来确定具体要加入事务控制的方法 -->
        <aop:advisor advice-ref="txAdvice" pointcut-ref="allMethods" />

    </aop:config>

    <!-- 整合Spring第一步创建JavaMailSenderImpl对象 -->
    <bean id="mailSender" class="org.springframework.mail.javamail.JavaMailSenderImpl">
        <property name="javaMailProperties">
            <props>
                <prop key="mail.smtp.auth">true</prop>
            </props>
        </property>
    </bean>

    <!-- 使用Spring的ThreadPoolTaskExecutor可以方便实现多线程的程序 -->
    <bean id="taskExecutor"
        class="org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor">
        <property name="corePoolSize" value="5" />
        <property name="maxPoolSize" value="10" />
        <property name="queueCapacity" value="25" />
    </bean>

    <!-- 配置ProcessEngine -->
    <bean id="springHelper" class="org.jbpm.pvm.internal.processengine.SpringHelper">
        <property name="jbpmCfg" value="spring-jbpm4.cfg.xml"></property>
    </bean>
    <bean id="processEngine" factory-bean="springHelper" factory-method="createProcessEngine" />

</beans>

三、数据库配置文件jdbc.properties

jdbc.driver = com.mysql.jdbc.Driver
jdbc.url = jdbc:mysql:///ssh_oa?characterEncoding=UTF-8
jdbc.user = root
jdbc.password=root

四、Web.xml配置文件

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
    http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">

    <!-- 配置Spring的用于初始化容器对象的监听器 -->
    <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>
    <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>classpath:applicationContext*.xml</param-value>
    </context-param>

    <listener>
        <listener-class>com.ssh.oa.filter.InitPrivilegeListener</listener-class>
    </listener>

    <filter>
        <filter-name>CharacterEncodingFilter</filter-name>
        <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
        <init-param>
            <param-name>encoding</param-name>
            <param-value>UTF-8</param-value>
        </init-param>
    </filter>
    <filter-mapping>
        <filter-name>CharacterEncodingFilter</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>

    <!-- 配置Spring的用于解决懒加载问题的过滤器 -->
    <filter>
        <filter-name>OpenSessionInViewFilter</filter-name>
        <filter-class>org.springframework.orm.hibernate3.support.OpenSessionInViewFilter</filter-class>
    </filter>
    <filter-mapping>
        <filter-name>OpenSessionInViewFilter</filter-name>
        <url-pattern>*.action</url-pattern>
    </filter-mapping>

    <!-- 配置Struts2的核心的过滤器 -->
    <filter>
        <filter-name>struts2</filter-name>
        <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
    </filter>
    <filter-mapping>
        <filter-name>struts2</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>

    <listener>
        <listener-class>org.apache.struts2.dispatcher.ng.listener.StrutsListener</listener-class>
    </listener>

    <welcome-file-list>
        <welcome-file>login.jsp</welcome-file>
    </welcome-file-list>
</web-app>

五、相关jar包

activation.jar
antlr-2.7.6.jar
antlr-runtime.jar
aopalliance.jar
asm-3.3.jar
asm-commons-3.3.jar
asm-tree-3.3.jar
aspectjrt.jar
aspectjweaver.jar
c3p0-0.9.1.jar
cglib-nodep-2.1_3.jar
com.springsource.org.aopalliance-1.0.0.jar
com.springsource.org.apache.commons.logging-1.1.1.jar
com.springsource.org.apache.log4j-1.2.15.jar
com.springsource.org.aspectj.weaver-1.6.8.RELEASE.jar
commons-beanutils-1.8.2.jar
commons-codec.jar
commons-collections-3.1.jar
commons-dbcp.jar
commons-fileupload-1.2.2.jar
commons-io-2.0.1.jar
commons-lang3-3.1.jar
commons-logging-1.1.1.jar
commons-pool.jar
dom4j-1.6.1.jar
freemarker-2.3.19.jar
hibernate-jpa-2.0-api-1.0.1.Final.jar
hibernate3.jar
javassist-3.12.0.GA.jar
jbpm-bpmn.jar
jbpm-console-form-plugin.jar
jbpm-console-graphView-plugin.jar
jbpm-console-integration.jar
jbpm-console-reports.jar
jbpm-db.jar
jbpm-examples-tests.jar
jbpm-jboss.jar
jbpm-test-db-tests.jar
jbpm-tomcat6.jar
jbpm.jar
joda-time.jar
jpdl-4.4.xsd
jsf-api.jar
jsf-impl.jar
jstl-1.2.jar
jta-1.1.jar
junit-4.10.jar
log4j-1.2.16.jar
mail.jar
mysql-connector-java-5.1.17-bin.jar
ognl-3.0.5.jar
org.springframework.aop-3.1.3.RELEASE.jar
org.springframework.asm-3.1.3.RELEASE.jar
org.springframework.aspects-3.1.3.RELEASE.jar
org.springframework.beans-3.1.3.RELEASE.jar
org.springframework.context-3.1.3.RELEASE.jar
org.springframework.context.support-3.1.3.RELEASE.jar
org.springframework.core-3.1.3.RELEASE.jar
org.springframework.expression-3.1.3.RELEASE.jar
org.springframework.instrument-3.1.3.RELEASE.jar
org.springframework.instrument.tomcat-3.1.3.RELEASE.jar
org.springframework.jdbc-3.1.3.RELEASE.jar
org.springframework.jms-3.1.3.RELEASE.jar
org.springframework.orm-3.1.3.RELEASE.jar
org.springframework.test-3.1.3.RELEASE.jar
org.springframework.transaction-3.1.3.RELEASE.jar
org.springframework.web-3.1.3.RELEASE.jar
org.springframework.web.portlet-3.1.3.RELEASE.jar
org.springframework.web.servlet-3.1.3.RELEASE.jar
org.springframework.web.struts-3.1.3.RELEASE.jar
pager-taglib.jar
sitemesh-2.4.jar
slf4j-api-1.6.1.jar
slf4j-log4j12-1.7.2.jar
spring-aop-3.2.0.RELEASE.jar
spring-aspects-3.2.0.RELEASE.jar
spring-beans-3.2.0.RELEASE.jar
spring-context-3.2.0.RELEASE.jar
spring-core-3.2.0.RELEASE.jar
spring-expression-3.2.0.RELEASE.jar
spring-jdbc-3.2.0.RELEASE.jar
spring-orm-3.2.0.RELEASE.jar
spring-test-3.2.0.RELEASE.jar
spring-tx-3.2.0.RELEASE.jar
spring-web-3.2.0.RELEASE.jar
struts2-convention-plugin-2.3.7.jar
struts2-core-2.3.7.jar
struts2-json-plugin-2.3.7.jar
struts2-sitemesh-plugin-2.3.4.1.jar
struts2-spring-plugin-2.3.7.jar
xwork-core-2.3.7.jar

六、Dao层的基本方法

1)DaoSupport.java

public interface DaoSupport<T> {

    public void save(T t);
    public void update(T t);
    public void delete(Serializable...ids);
    public T loadById(Serializable id);
    public void delete(Long id);
    public T getById(Long id);
    public T findByObj(String hql, Object...objs);
    public List<T> listByIds(Serializable...ids);
    public List<T> findByIds(Long...ids);
    public List<T> listAll();
    public PageBean getPageBean(int pageNum, int pageSize, QueryHelper queryHelper);

}

2)DaoSupportImpl.java

@SuppressWarnings("all")
public class DaoSupportImpl<T> extends HibernateDaoSupport implements DaoSupport<T> {

    private Class<T> clazz;

    public DaoSupportImpl() {
        ParameterizedType type = (ParameterizedType) this.getClass().getGenericSuperclass();
        clazz = (Class<T>) type.getActualTypeArguments()[0];
    }

    /*
     * private Class<T> getClazz(){ if (clazz == null) { clazz =
     * ((Class<T>)(((ParameterizedType
     * )(this.getClass().getGenericSuperclass())).getActualTypeArguments()[0]));
     * } return clazz; }
     */

    /*
     * @Resource private SessionFactory sessionFactory;
     *
     * protected Session getSession(){ return
     * sessionFactory.getCurrentSession(); }
     */

    @Resource(name = "sessionFactory")
    public void setSuperSessionFactory(SessionFactory sessionFactory) {
        super.setSessionFactory(sessionFactory);
    }

    @Override
    public void save(T t) {
        getSession().save(t);
    }

    @Override
    public void update(T t) {
        getSession().update(t);
    }

    @Override
    public void delete(Serializable... ids) {
        if (ids != null && ids.length == 1) {
            Object object = loadById(ids);
            getSession().delete(object);
        } else if (ids != null && ids.length > 1) {
            for (Serializable id : ids) {
                System.out.println("id===" + id);
                Object object = loadById(id);
                if (object != null) {
                    getSession().delete(object);
                }
            }
        }

    }

    @Override
    public T loadById(Serializable id) {
        if (id != null) {
            return (T) getSession().load(clazz, id);
        }
        return null;
    }

    @Override
    public void delete(Long id) {
        Object object = getById(id);
        getHibernateTemplate().delete(object);
    }

    @Override
    public T getById(Long id) {
        if (id != null) {
            return (T) getSession().load(clazz, id);
        }
        return null;
    }

    @Override
    public T findByObj(String hql, Object... objs) {
        return (T) getQuery(hql, objs).uniqueResult();
    }

    public Query getQuery(String hql, Object... objs) {
        Query query = getSession().createQuery(hql);
        if (objs != null && objs.length > 0) {
            for (int i = 0; i < objs.length; i++) {
                query.setParameter(i, objs[i]);
            }
        }
        return query;
    }

    @Override
    public List<T> listAll() {
        String hql = " FROM " + clazz.getSimpleName();
        return this.getSession().createQuery(hql).list();
    }

    @Override
    public List<T> listByIds(Serializable... ids) {
        if (ids != null && ids.length > 0) {
            String hql = " FROM " + clazz.getSimpleName() + " WHERE id in(:ids)";
            return getSession().createQuery(hql).setParameterList("ids", ids).list();
        }
        return Collections.EMPTY_LIST;
    }

    @Override
    public List<T> findByIds(Long... ids) {
        if (ids != null && ids.length > 0) {
            String hql = " FROM " + clazz.getSimpleName() + " WHERE id in(:ids)";
            return getSession().createQuery(hql).setParameterList("ids", ids).list();
        }
        return Collections.EMPTY_LIST;
    }

    @Override
    public PageBean getPageBean(int pageNum, int pageSize, QueryHelper queryHelper) {
        String listHQL = queryHelper.getListHQL();

        List<Object> paramList = queryHelper.getParams();
        Query listQuery = getSession().createQuery(listHQL);
        if (paramList != null) { // 设置参数
            for (int i = 0; i < paramList.size(); i++) {
                listQuery.setParameter(i, paramList.get(i));
            }
        }
        int first = (pageNum - 1) * pageSize;
        List dataList = listQuery.setFirstResult(first).setMaxResults(pageSize).list();

        String countHQL = queryHelper.getCountHQL();
        Query countQuery = getSession().createQuery(countHQL);
        if (paramList != null) { // 设置参数
            for (int i = 0; i < paramList.size(); i++) {
                countQuery.setParameter(i, paramList.get(i));
            }
        }
        Long recordCount = (Long) countQuery.uniqueResult();
        PageBean pageBean = new PageBean(pageNum, pageSize, recordCount.intValue(), dataList);
        return pageBean;
    }

}

七、分页类

@SuppressWarnings("all")
public class PageBean {

    private List dataList = new ArrayList();// 本页的数据列表
    private int pageNum;// 当前页
    private int pageSize;// 每页显示多少条
    private int recordCount;// 总记录数
    private int pageCount;// 总页数
    private int beginIndex;// 页码列表的开始索引(包含)
    private int endIndex;// 页码列表的结束索引(包含)

    public PageBean(int pageNum, int pageSize, int recordCount, List dataList){
        this.pageNum = pageNum;
        this.pageSize = pageSize;
        this.dataList = dataList;
        this.recordCount = recordCount;
        // 计算总页码
        pageCount = (recordCount + pageSize - 1)/pageSize;

        //如果pageCount<10就全部显示
        if (pageCount <= 10) {
            beginIndex = 1;
            endIndex = pageCount;
        }else {
            //如果pageCount>10显示pageNum前4后5
            beginIndex = pageNum - 4;
            endIndex = pageNum + 5;
            if (pageNum<1) {
                beginIndex = 1;
                endIndex = 10;
            }else if (pageNum > pageCount) {
                beginIndex = pageNum - 9;
                endIndex = pageCount;
            }
        }
    }

    public List getDataList() {
        return dataList;
    }
    public void setDataList(List dataList) {
        this.dataList = dataList;
    }
    public int getPageSize() {
        return pageSize;
    }
    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }

    public int getPageNum() {
        return pageNum;
    }

    public void setPageNum(int pageNum) {
        this.pageNum = pageNum;
    }

    public int getRecordCount() {
        return recordCount;
    }

    public void setRecordCount(int recordCount) {
        this.recordCount = recordCount;
    }

    public int getPageCount() {
        return pageCount;
    }

    public void setPageCount(int pageCount) {
        this.pageCount = pageCount;
    }

    public int getBeginIndex() {
        return beginIndex;
    }

    public void setBeginIndex(int beginIndex) {
        this.beginIndex = beginIndex;
    }

    public int getEndIndex() {
        return endIndex;
    }

    public void setEndIndex(int endIndex) {
        this.endIndex = endIndex;
    }

}
时间: 2024-10-15 21:32:05

SSH 基本配置--OA系统的经典配置的相关文章

bboss平台子系统配置及系统登录相关配置介绍

bboss平台可以包含一个主系统和多个子系统,每个子系统可以配置独立的子系统登录界面以及登录成功的跳转界面. 主系统配置: 主系统配置文件为/resources/module.xml文件,可以在module.xml中配置子系统和主系统的模块.首页及菜单 1.子系统配置 Xml代码   <subsystem name="移动门户"  id="mbp" module="module-mbp.xml" successRedirect="

Linux系统下如何配置SSH_Centos7 ssh连接配置 CentOS7下安全配置

转自:http://www.linuxdown.net/install/config/2016/0611/5853.html Linux系统下如何配置SSH_Centos7 ssh连接配置 CentOS7下安全配置SSH 时间:2016-06-11 11:13来源:未知 作者:Linux先生 举报 点击:1804次 SSH 通常是我们进入新伺服器的第一个应用程式,它也取代了telnet 和rsh 成为管理伺服器的最主要介面. SSH 通常是我们进入新伺服器的第一个应用程式,它也取代了telnet

SSH OA系统的三个细节问题

第一:点击新建之后,顶级部门显示当前的上级部门而不是最顶级的NULL parentId有值就可以回显所以代码如下: 1.新建按钮的链接需要更改: <s:a action="department_addUI?parentId=%{parentId}"><img src="${pageContext.request.contextPath}/style/images/createNew.png" /></s:a> 2.相应的Actio

路由器逆向分析------MIPS系统网络的配置(QEMU)

本文博客地址:http://blog.csdn.net/qq1084283172/article/details/69378333 MIPS系统网络的配置  使用QEMU 模拟正在运行的MIPS系统并配置MIPS系统网络,这样本地主机ubuntu系统就可以和QEMU虚拟机进行网络通讯和传输数据了.在进行MIPS程序的测试时是很有用处. 01.获取安装依赖文件,执行下面的命令: $ sudo apt-get install bridge-utils uml-utilities 02.修改 ubun

树莓派玩耍笔记1 -- 开箱 &amp; 安装系统以及简单配置

零.前言 树莓派是什么? 吃的么? 呵呵,如果您连这个还不知道,真是out 了.麻烦出门左拐,百度去(或者,看看官网去?),算了,还是粘贴一些大家都知道的树莓派百科吧: 树莓派由注册于英国的慈善组织"Raspberry Pi 基金会"开发,Eben·Upton/埃·厄普顿为项目带头人.2012年3月,英国剑桥大学埃本·阿普顿(Eben Epton)正式发售世界上最小的台式机,又称卡片式电脑,外形只有信用卡大小,却具有电脑的所有基本功能,这就是Raspberry Pi电脑板,中文译名&q

&#8203;查看Linux系统的所有配置命令

查看Linux系统的所有配置命令     1.查看主板的序列号: dmidecode | grep -i 'serial number'     2.查看CPU信息: cat /proc/cpuinfo dmesg | grep -i 'cpu' dmidecode -t processor     3.查看内存信息: cat /proc/meminfo free -m vmstat     5.查看网卡信息: dmesg | grep -i 'eth' cat /etc/sysconfig/h

使用MDT2013部署Win8系统之六-配置更新及导入启动镜像

我们设置的标准任务在进行系统部署时, 需要配置一个PE引导系统以启动镜像 现在我们来操作,右击"MDT Deployment Share"选择属性 在"通用"选项卡中,可以看到支持32位和64位操作系统平台.因为我的测试环境中的操作系统均为64位,所以这里我们选择x64 切换到"Windows PE"选项卡,设置x64 PE系统的名称和生成的PE类型,选择平台"x64",这里ISO是可选项,因为在我的测试环境中可以直接使用WI

t3用户-角色-权限hibernate经典配置

[java] view plain copy print? 用户-角色-权限hibernate经典配置. [java] view plain copy print? 既然有人问起,我就写下说明吧.在文章中间的配置文件那里.权当回忆一下,也帮助更多人.这是以前学校时写的,没有注释.都是贴的代码笔记.看到的莫要见怪.欢迎学习交流. [java] view plain copy print? [java] view plain copy print? 首先是三个实体类: [java] view pla

mount挂载,dd 工具,配置配额系统,RAID阵列,逻辑卷管理器LVM

mount mount挂载 vim /etc/fstab 将常用的挂载的设备写入系统表中 文件挂载配置文件 /etc/fstab /etc/fstab每行定义一个要挂载的文件系统: 要挂载的设备或伪文件系统 挂载点 文件系统类型 挂载选项 转储频率 自检次序 要挂载的设备或伪文件系统: 设备文件.LABEL(LABEL="").UUID(UUID="").伪文件系统名称(proc, sysfs) 挂载选项:defaults 转储频率:0:不做备份 每天转储 每隔一天