zoukankan      html  css  js  c++  java
  • 搭建一个SSH项目框架的步骤

    1、导入jar包(38个)

    2、配置文件

    applicationContext,xml (beans.xml) 

    (数据源、LocalSessionFactoryBean、事务管理器、事务通知、AOP切面、组件扫描、对注解提供支持)

    Struts.xml

    3,web.xml

    Struts2过滤器

    <filter>

       <filter-name>action</filter-name>

       <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter

    </filter-class>

    </filter>

    Spring 的监听器contextConfigLocation

    <context-param>

       <param-name>contextConfigLocation</param-name>

       <param-value>classpathbeans.xml</param-value>

    </context-param>

    <!--配置spring框架的上下文载入监听器-->

    <listener>

    <listener-class>org.springframework.web.context.ContextLoaderListener

    </listener-class>

    </listener>

     

    数据源配置:

    <bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource">

    <property name="driverClass" value="${driverClass}"></property>

    <property name="jdbcUrl" value="${jdbcUrl}"></property>

    <property name="user" value="${user}"></property>

    <property name="password" value="${password}"></property>

    <property name="initialPoolSize" value="${initialPoolSize}"></property>

    <property name="maxPoolSize" value="${maxPoolSize}"></property>

    <property name="minPoolSize" value="${minPoolSize}"></property>

    </bean>

    Jdbc.properties  

        MySQL

    driverClass=com.mysql.jdbc.Driver

    jdbcUrl=jdbc:mysql://localhost:3306/数据库名

    user=root

    password=root

    initialPoolSize=30

    maxPoolSize=50

    minPoolSize=30

         SqlServer

    jdbc.driverClassName=net.sourceforge.jtds.jdbc.Driver

    jdbc.url=jdbc:jtds:sqlserver://localhost:1433/数据名

    jdbc.username=sa

    jdbc.password=abc123

    initialPoolSize=30

    maxPoolSize=50

    minPoolSize=30

    Oracle

    jdbc.driverClassName=oracle.jdbc.driver.OracleDriver

    jdbc.url=jdbc:orcale:thin://localhost:1521/数据库名

    jdbc.username=wapcms

    jdbc.password=wapcms

     

  • 相关阅读:
    C++面试题
    kalman滤波原理
    开blog
    Linux图片批处理
    Debian使用相关
    Ubuntu grub引导修复
    Debian系统vim中文显示乱码问题
    Debian配置Apache2支持mod-python和cgi模块
    linux下解压被分割的zip文件
    Ubuntu 16.04 启动错误 "a start job is running for hold until boot process finishes up"
  • 原文地址:https://www.cnblogs.com/lujiquan/p/3950662.html
Copyright © 2011-2022 走看看