The classic configuration of SSH basic configuration--oa System

Source: Internet
Author: User
Tags aop reserved ssh jbpm

Description:
Classic configuration of OA system when this SSH architecture
Is definitely the most classic configuration, you deserve to have

First, structs configuration file

<?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 "/> <!--global internationalization configuration--&
    Gt <constant name= "struts.custom.i18n.resources" value= "Messages" ></constant> <constant name= " Struts.action.extension "value=" Action,do "/> <constant name=" Struts.configuration.xml.reload "true" ></constant> <constant name= "struts.multipart.maxSize" value= "10240000" ></constant> <!--table The action is created by spring and can be injected directly into the--> <constant name= "Struts.objectfactory value=" using spring Dependency Injection Org.apache.struts2.spring.StrutsSpringObjectFactory "/> <constant name= struts.ui.theme" value= "simple" > </constant> <!--allow static method--> <constant name= "struts.ognl.allowStaticMethodAccess" value= "true" &G T;</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= "Privilegeintercep"
            Tor "></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/exceptio
            n.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> <!--with the method name must write--> <action na
            Me= "*_*" 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" Typ E= "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" 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&
            lt;/param> <param name= "InputName" >inputStream</param> </result> <result name= "Download" type= "stream" > <param name= "ContentType" >application/octet-stream& lt;/param> <param name= "InputName" >inputStream</param> <param name= "cont Entdisposition ">attachment;filename=" ${#fileName}</param> </result> ; result name= "Tomyapplicationlist" type= "redirectaction" >{1}_myApplicationList</result> <result na Me= "Tomytasklist" type= "redirectaction" >{1}_myTaskList</result> </action> </package> &L T;/struts>

Second, applicationcontext.xml configuration file

<?xml version= "1.0" encoding= "UTF-8"?> <beans "xmlns=" 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 "&
    Gt <!--Configure automatic proxy--> <aop:aspectj-autoproxy/> <context:annotation-config/> <context:compone Nt-scan base-package= "Com.ssh.oa.*" ></context:component-scan&Gt <!--<aop:aspectj-autoproxy proxy-target-class= "true"/>--> <!--introduces external properties file--> <con Text:property-placeholder location= "Classpath:jdbc.properties"/> <!--database connection pool--> <bean id= "Datasourc E "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}" ></pro Perty> <!--other configurations--> <!--are initialized to get three connections, which should be between Minpoolsize and Maxpoolsize. Default:3--> <property name= "Initialpoolsize" value= "3" ></property> <!--the minimum number of connections reserved in the connection pool. Default:3--> <property name= "Minpoolsize" value= "3" ></property> <!--the maximum number of connections reserved in the connection pool. Default:15--> <property name= "MaxPoolsize "value=" 5 ></property> <!--the number of connections that were fetched at one time when the connection in the connection pool was depleted c3p0. Default:3--> <property name= "Acquireincrement" value= "3" ></property> <!--control the pre loaded in the data source Number of paredstatements. If both maxstatements and maxstatementsperconnection are 0, the cache is closed. default:0--> <property name= "maxstatements" value= "8" ></property> <!--Max Statementsperconnection defines the maximum number of cached statements that a single connection has within a connection pool. default:0--> <property name= "Maxstatementsperconnection" value= "5" ></property> <!--maximum empty Free time, not used within 1800 seconds, the connection is discarded. If 0, it will never be discarded.  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" >
      <!--reference database connection pool-->  <property name= "DataSource" ref= "DataSource" ></property> <!--configuration Hibernate other Properties--> < 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" & gt;update</prop> <prop key= "Hibernate.connection.autocommit" >true</prop> ;/props> </property> <!--referencing hbm mapping file--> <property name= "Mappingdirectorylocatio NS "> <list> <value>classpath:com/ssh/oa/domain</value> </l
                ist> </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> &LT;VALUE&GT;CLASSPATH:JBPM.REPOSITORY.HB
        M.xml</value> <value>classpath:jbpm.task.hbm.xml</value> </list> </property> <!--<property name= "Packagestoscan" > <value>com.ssh.document.domain</value > </property>--> </bean> <!--transaction manager--> <bean id= "TransactionManager "class=" Org.springframework.orm.hibernate3.HibernateTransactionManager "> <property name=" Sessionfac Tory "ref=" Sessionfactory "></property> </bean> <tx:annotation-driven transaction-manager=" Trans ActionManager "/> <!--Configure which methods to add to the transaction control--> <tx:advice id=" Txadvice ' transaction-manager= "Transactionma Nager "> <tX:attributes> <!--Let all methods add to the transaction management, in order to improve efficiency, some methods such as queries can be set to read-only transactions--> <tx:method name= "*" P  ropagation= "REQUIRED" read-only= "true"/> <!--The following methods are possible to design a modified method and cannot be set to read-only--> <tx:method Name= "add*" propagation= "REQUIRED"/> <tx:method name= "del*" propagation= "REQUIRED"/> & Lt;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> <!--configuration aop,spring is a transaction through AOP Managed--> <aop:config> <!--settings pointcut indicate which methods are to be added to the transaction--> <!--The following transactions are declared in DAO, but are usually serv Ice to handle the logical relationship of multiple business objects, injection deletion, moreNew, and so, if throwing an exception after a step has been executed will result in incomplete data, so the transaction should not be handled at the DAO layer, but should be in service, which is a handy tool provided by spring, declarative transaction--> <a Op:pointcut id= "Allmethods" expression= Execution (* com.ssh.oa.base.*.* (..)) or execution (* com.ssh.oa.service .. *.*(..))" /> <!--through the advisor to determine the specific way to add transaction control--> <aop:advisor advice-ref= "Txadvice" pointcut-ref= DS "/> </aop:config> <!--integration Spring First step Create Javamailsenderimpl object--> <bean id=

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.