延庆县专业网站制作网站建设,单页营销式网站模板下载,杭州推广平台有哪些,中国最好的室内设计网下载地址#xff1a;源码和详细搭建步骤 使用myeclipse2014搭建ssh框架1. spring搭建2. struts2搭建3. hibernate搭建4. applicationContext编写5. web.xml编写1. spring搭建 创建一个javaweb项目 导入spring框架 最高版本3.1支持 4. 选择类库
spring导入完毕
2. str…下载地址源码和详细搭建步骤
使用myeclipse2014搭建ssh框架1. spring搭建2. struts2搭建3. hibernate搭建4. applicationContext编写5. web.xml编写1. spring搭建 创建一个javaweb项目 导入spring框架 最高版本3.1支持 4. 选择类库
spring导入完毕
2. struts2搭建 3. hibernate搭建 选择数据驱动 4. applicationContext编写
?xml version1.0 encodingUTF-8?
beansxmlnshttp://www.springframework.org/schema/beansxmlns:xsihttp://www.w3.org/2001/XMLSchema-instancexmlns:phttp://www.springframework.org/schema/pxmlns:txhttp://www.springframework.org/schema/txxmlns:contexthttp://www.springframework.org/schema/contextxsi:schemaLocationhttp://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsdhttp://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.1.xsdhttp://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd!-- 注解ioc扫描 --context:component-scan base-packagecom.test /!-- bean iddataSourceclassorg.apache.commons.dbcp.BasicDataSourceproperty nameurlvaluejdbc:mysql://localhost:3306/ssh_study/propertyproperty nameusername valueroot/propertyproperty namepassword value123456/property/bean --!-- ComboPooledDataSource数据源配置 --bean iddataSourceclasscom.mchange.v2.c3p0.ComboPooledDataSourceproperty namedriverClass valuecom.mysql.jdbc.Driver/propertyproperty namejdbcUrlvaluejdbc:mysql://localhost:3306/ssh_study/propertyproperty nameuser valueroot/propertyproperty namepassword value123456/property/bean!-- session工厂 --bean idsessionFactoryclassorg.springframework.orm.hibernate3.LocalSessionFactoryBeanproperty namedataSourceref beandataSource //propertyproperty namehibernatePropertiespropsprop keyhibernate.dialectorg.hibernate.dialect.MySQLDialect/prop!-- 展示sql --prop keyhibernate.show_sqltrue/propprop keyhibernate.format_sqltrue/prop/props/propertyproperty namemappingResourceslistvaluecom/test/entity/Users.hbm.xml/value/list/property/bean!-- hibernate 模板 用来操作数据库 --bean classorg.springframework.orm.hibernate3.HibernateTemplateproperty namesessionFactory refsessionFactory //bean!-- 声明式事务管理器 --bean idtransactionManager classorg.springframework.orm.hibernate3.HibernateTransactionManagerproperty namesessionFactory refsessionFactory //bean!-- 事务注解驱动 --tx:annotation-driven transaction-managertransactionManager/!-- action --bean iduserAction classcom.test.action.UserAction scopeprototype/bean/beans5. web.xml编写
?xml version1.0 encodingUTF-8?
web-app xmlns:xsihttp://www.w3.org/2001/XMLSchema-instance xmlnshttp://java.sun.com/xml/ns/javaee xsi:schemaLocationhttp://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd version3.0display-namessh01/display-namelistenerlistener-classorg.springframework.web.context.ContextLoaderListener/listener-class/listenercontext-paramparam-namecontextConfigLocation/param-nameparam-valueclasspath:applicationContext.xml/param-value/context-param!-- 新增配置 openSessionViewFilter session的开关给它管理 --filterfilter-nameopenSessionInViewFilter/filter-namefilter-classorg.springframework.orm.hibernate3.support.OpenSessionInViewFilter/filter-class/filterfilter-mappingfilter-nameopenSessionInViewFilter/filter-nameurl-pattern/*/url-pattern/filter-mappingfilterfilter-namestruts2/filter-namefilter-classorg.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter/filter-class/filterfilter-mappingfilter-namestruts2/filter-nameurl-pattern/*/url-pattern/filter-mapping
/web-app