1. 程式人生 > 其它 >ssm框架配置說明

ssm框架配置說明

技術標籤:ssm

ssm框架整合

首先明確一點就是,web專案的入庫是在web.xml下的,所有的配置檔案無論怎麼注入都要最終到這個配置檔案裡面(日誌檔案除外)

首先配置

pom.xml

(springframework整合spring框架,整合mybatis框架,mysql驅動,druid連線池,整合log4j,ackson Json處理工具包,Servlet/JSP/JSTL,單元測試,Spring對JDBC資料訪問進行封裝的所有類)

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion> <groupId>com.zxl</groupId> <artifactId>test</artifactId> <version>0.0.1-SNAPSHOT</version> <packaging>war</
packaging
>
<!-- 集中定義依賴版本號 --> <properties> <junit.version>4.10</junit.version> <spring.version>4.1.3.RELEASE</spring.version> <mybatis.version>3.2.8</mybatis.version> <mybatis.spring.version>1.2.2</mybatis.spring.version>
<mysql.version>5.1.32</mysql.version> <druid.version>1.1.6</druid.version> <slf4j.version>1.6.4</slf4j.version> <jstl.version>1.2</jstl.version> <servlet-api.version>2.5</servlet-api.version> <jsp-api.version>2.0</jsp-api.version> <jackson.version>2.4.2</jackson.version> </properties> <dependencies> <!-- 單元測試 --> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>${junit.version}</version> <scope>test</scope> </dependency> <!-- 整合spring框架(包含springmvc) 這個jar檔案包含springmvc開發時的核心類, 同時也會將依賴的相關jar檔案引入進來(spring的核心jar檔案也包含在內) --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-webmvc</artifactId> <version>${spring.version}</version> </dependency> <!--這個jar檔案包含對Spring對JDBC資料訪問進行封裝的所有類 --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-jdbc</artifactId> <version>${spring.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-aspects</artifactId> <version>${spring.version}</version> </dependency> <!-- 整合mybatis框架 --> <dependency> <groupId>org.mybatis</groupId> <artifactId>mybatis</artifactId> <version>${mybatis.version}</version> </dependency> <dependency> <groupId>org.mybatis</groupId> <artifactId>mybatis-spring</artifactId> <version>${mybatis.spring.version}</version> </dependency> <!-- mysql驅動 --> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <version>${mysql.version}</version> </dependency> <!-- druid連線池 --> <dependency> <groupId>com.alibaba</groupId> <artifactId>druid</artifactId> <version>${druid.version}</version> </dependency> <!-- 整合log4j --> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-log4j12</artifactId> <version>${slf4j.version}</version> </dependency> <!-- Jackson Json處理工具包 --> <!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-databind --> <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-databind</artifactId> <version>2.10.0.pr1</version> </dependency> <!-- Servlet/JSP/JSTL --> <dependency> <groupId>javax.servlet</groupId> <artifactId>servlet-api</artifactId> <version>${servlet-api.version}</version> <scope>provided</scope> </dependency> <dependency> <groupId>javax.servlet</groupId> <artifactId>jsp-api</artifactId> <version>${jsp-api.version}</version> <scope>provided</scope> </dependency> <dependency> <groupId>jstl</groupId> <artifactId>jstl</artifactId> <version>${jstl.version}</version> </dependency> </dependencies> </project>

web.xml

<?xml version="1.0" encoding="UTF-8"?>
<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_2_5.xsd"
         version="2.5">
  <!--專案名字-->
  <display-name>SSMDemo</display-name>
  <!--專案主頁尋找地址-->
  <welcome-file-list>
    <welcome-file>index.html</welcome-file>
    <welcome-file>index.htm</welcome-file>
    <welcome-file>index.jsp</welcome-file>
    <welcome-file>default.html</welcome-file>
    <welcome-file>default.htm</welcome-file>
    <welcome-file>default.jsp</welcome-file>
  </welcome-file-list>

  <!-- 配置前端控制器 -->
  <servlet>
    <servlet-name>springmvc</servlet-name>
    <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    <!--使用萬用字元載入spring容器這裡不僅僅載入了springmvc也載入了applicationContext.xml等什麼的-->
    <init-param>
      <param-name>contextConfigLocation</param-name>
      <param-value>classpath:spring/*.xml</param-value>
    </init-param>

  </servlet>
  <!--攔截所有的請求-->
  <servlet-mapping>
    <servlet-name>springmvc</servlet-name>
    <url-pattern>/</url-pattern>
  </servlet-mapping>


applicationContext.xml

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:context="http://www.springframework.org/schema/context" xmlns:p="http://www.springframework.org/schema/p"
       xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
	http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.0.xsd
	http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.0.xsd
	http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-4.0.xsd">

    <!-- 1.載入jdbc.properties檔案的位置 -->
    <context:property-placeholder location="classpath:db.properties" />

    <!-- 2.配置durid連線池, id是固定值, class是druid連線池類的全路徑 -->
    <bean id="dataSource" class="com.alibaba.druid.pool.DruidDataSource">
        <!-- 配置連線資料庫的基本資訊 -->
        <property name="driverClassName" value="${db.driverClassName}"></property>
        <property name="url" value="${db.url}"></property>
        <property name="username" value="${db.username}"></property>
         <property name="password" value="${db.password}"></property>
    </bean>

<!--    &lt;!&ndash;事務管理器,對mybatis操作資料庫事務控制,spring使用jdbc的事務控制類&ndash;&gt;-->
<!--    <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">-->
<!--        &lt;!&ndash;資料來源&ndash;&gt;-->
<!--        <property name="dataSource" ref="dataSource"/>-->

<!--    </bean>-->



<!--    &lt;!&ndash;通知也叫傳播行為  transaction-manager通知給事務管理器&ndash;&gt;-->
<!--    <tx:advice id="txAdvice" transaction-manager="transactionManager">-->
<!--        <tx:attributes>-->
<!--            <tx:method name="save*" propagation="REQUIRED"/>-->
<!--            <tx:method name="delete*" propagation="REQUIRED"/>-->
<!--            <tx:method name="insert*" propagation="REQUIRED"/>-->
<!--            <tx:method name="update*" propagation="REQUIRED"/>-->
<!--            &lt;!&ndash;支援事務。碼暈就算了,這個是隻讀&ndash;&gt;-->
<!--            <tx:method name="find*" propagation="SUPPORTS" read-only="true"/>-->
<!--            <tx:method name="get*" propagation="SUPPORTS" read-only="true"/>-->
<!--            <tx:method name="select*" propagation="SUPPORTS" read-only="true"/>-->
<!--        </tx:attributes>-->

<!--    </tx:advice>-->
<!--&lt;!&ndash;aop事務控制&ndash;&gt;-->
<!--    <aop:config>-->
<!--        &lt;!&ndash;切點,切om.wtu.下的service下的impl下的*(所有類的)*(所有方法)(..)不管什麼引數  和下面的pointcut一一對應&ndash;&gt;-->
<!--        <aop:advisor advice-ref="txAdvice" pointcut="execution(* com.wtu.service.impl.*.*(..))"/>-->
<!--    </aop:config>-->


    <!-- 3.整合Spring和mybatis框架 將SqlSession等物件的建立交給Spring容器 id值(sqlSessionFactory)是固定值 -->
    <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
        <!-- 3.1 指定mybatis核心配置檔案的位置 -->
        <property name="configLocation" value="classpath:mybatis/mybatis-config.xml" />
        <!-- 3.2 配置連線池(資料來源) ref指向連線池bean物件的id值 -->
        <property name="dataSource" ref="dataSource" />
        <!-- 3.3 掃描所有的XxxMapper.xml對映檔案, 讀取其中配置的SQl語句 -->
        <property name="mapperLocations" value="classpath:mybatis/mapper/*.xml" />
    </bean>


    <!-- 4. 定義mapper介面掃描器 配置所有mapper介面所在的包路徑, 將來由Spring + myBatis框架來為介面 提供實現類,
        以及實現類的例項也有Spring框架來建立 -->
    <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
        <!-- 掃描所有XxxMapper介面, 將介面例項的建立交給Spring容器 -->
        <property name="basePackage" value="com.wtu.dao" />
        <!--猜測加上之後,可以通過XxxMappe.xml和XxxMapper.java自動匹配,要在同一個目錄下-->
<!--        <property name="sqlSessionFactoryBeanName" value="sqlSessionFactory"/>-->
    </bean>

    <!-- 5.配置需要掃描的包(server層): Spring自動去掃描base-package下的類 如果掃描到的類上有@Controller,@Service,@Component等註解,
        將會自動 將類註冊為bean(即由Spring建立例項) -->
    <context:component-scan base-package="com.wtu.service">
    </context:component-scan>

</beans>

springmvc-config.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:mvc="http://www.springframework.org/schema/mvc"
       xmlns:context="http://www.springframework.org/schema/context"
       xsi:schemaLocation="http://www.springframework.org/schema/mvc
						http://www.springframework.org/schema/mvc/spring-mvc-4.0.xsd
						http://www.springframework.org/schema/beans
						http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
						http://www.springframework.org/schema/context
          				http://www.springframework.org/schema/context/spring-context-4.0.xsd">

    <!-- 1.配置前端控制器訪問靜態資源(html/css/js等,否則靜態資源將無法訪問) -->
    <mvc:default-servlet-handler />

    <!-- 2.配置註解驅動,用於識別註解(比如@Controller) -->
    <mvc:annotation-driven></mvc:annotation-driven>

            <!-- 3.配置需要掃描的包: Spring自動去掃描base-package 下的類, 如果掃描到的類上有@Controller,@Service,@Component等註解
                將會自動將類註冊為bean -->
    <context:component-scan base-package="com.wtu.controller">
    </context:component-scan>

    <!-- 4.配置內部資源檢視解析器 prefix: 配置路徑字首 suffix: 配置檔案字尾 -->
    <bean
            class="org.springframework.web.servlet.view.InternalResourceViewResolver">
        <property name="prefix" value="/WEB-INF/pages/" />
        <property name="suffix" value=".jsp" />
    </bean>
    <!-- 對靜態資源的訪問 -->
    <mvc:resources location="/static/" mapping="/static/**" />

</beans>

mybatis-config.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE configuration
        PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-config.dtd">

<!-- MyBatis的全域性配置檔案 -->
<configuration >
    <!-- 整合mybatis和Spring框架, 需要將mybatis的相關配置
        在Spring的配置檔案中進行配置
     -->
</configuration>

db.properties

db.driverClassName=com.mysql.jdbc.Driver
db.url=jdbc:mysql://localhost:3306/myweb?characterEncoding=utf-8
db.username=root
db.password=123456

總結:

1.pom.xml配置如下

(springframework整合spring框架,整合mybatis框架,mysql驅動,druid連線池,整合log4j,ackson Json處理工具包,Servlet/JSP/JSTL,單元測試,Spring對JDBC資料訪問進行封裝的所有類)

2.web.xml配置如下

專案名字

專案主頁尋找地址

前端控制器(載入spring容器,在這個同時也載入springmvc)前端控制器就是用的DispatcherServlet

然後載入spring容器,我把spring所有的檔案全部放在看spring下面,所有我用萬用字元就行可以了

 <!-- 配置前端控制器 -->
 <servlet>
   <servlet-name>springmvc</servlet-name>
   <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
   <!--使用萬用字元載入spring容器這裡不僅僅載入了springmvc也載入了applicationContext.xml等什麼的-->
   <init-param>
     <param-name>contextConfigLocation</param-name>
     <param-value>classpath:spring/*.xml</param-value>
   </init-param>

攔截所有請求

 <!--攔截所有的請求-->
 <servlet-mapping>
   <servlet-name>springmvc</servlet-name>
   <url-pattern>/</url-pattern>
 </servlet-mapping>

applicationContext.xml配置如下

配置jdbc,先載入jdbc連線配置檔案的位置

<!-- 1.載入jdbc.properties檔案的位置 -->
    <context:property-placeholder location="classpath:db.properties" />

配置連線池durid,和c3p0等都可以


    <!-- 2.配置durid連線池, id是固定值, class是druid連線池類的全路徑 -->
    <bean id="dataSource" class="com.alibaba.druid.pool.DruidDataSource">
        <!-- 配置連線資料庫的基本資訊 -->
        <property name="driverClassName" value="${db.driverClassName}"></property>
        <property name="url" value="${db.url}"></property>
        <property name="username" value="${db.username}"></property>
         <property name="password" value="${db.password}"></property>
    </bean>

(配置事務管理,對mybatis操作資料庫事務控制,spring使用jdbc的事務控制類)(此專案前不清楚是做什麼的,不配置也可以)


  <!--事務管理器,對mybatis操作資料庫事務控制,spring使用jdbc的事務控制類-->
    <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
        <!--資料來源-->
        <property name="dataSource" ref="dataSource"/>

    </bean>

(傳播行為 transaction-manager通知給事務管理器)此專案前不清楚是做什麼的,不配置也可以)猜測是用來規範編碼,的在介面方法命名上要符合這個的規則

<!--通知也叫傳播行為  transaction-manager通知給事務管理器-->
    <tx:advice id="txAdvice" transaction-manager="transactionManager">
        <tx:attributes>
            <tx:method name="save*" propagation="REQUIRED"/>
            <tx:method name="delete*" propagation="REQUIRED"/>
            <tx:method name="insert*" propagation="REQUIRED"/>
            <tx:method name="update*" propagation="REQUIRED"/>
            <!--支援事務。碼暈就算了,這個是隻讀-->
            <tx:method name="find*" propagation="SUPPORTS" read-only="true"/>
            <tx:method name="get*" propagation="SUPPORTS" read-only="true"/>
            <tx:method name="select*" propagation="SUPPORTS" read-only="true"/>
        </tx:attributes>

    </tx:advice>

(事務控制)

<!--aop事務控制-->
    <aop:config>
        <!--切點,切om.wtu.下的service下的impl下的*(所有類的)*(所有方法)(..)不管什麼引數  和下面的pointcut一一對應-->
    <aop:advisor advice-ref="txAdvice" pointcut="execution(* com.wtu.service.impl.*.*(..))"/>
    </aop:config>

整合spring和mybatis框架,將SqlSessionFactory交個spring容器,讀取xml中的sql語句,然後交個spring來管理

   <!-- 3.整合Spring和mybatis框架 將SqlSession等物件的建立交給Spring容器 id值(sqlSessionFactory)是固定值 -->
    <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
        <!-- 3.1 指定mybatis核心配置檔案的位置 -->
        <property name="configLocation" value="classpath:mybatis/mybatis-config.xml" />
        <!-- 3.2 配置連線池(資料來源) ref指向連線池bean物件的id值 -->
        <property name="dataSource" ref="dataSource" />
        <!-- 3.3 掃描所有的XxxMapper.xml對映檔案, 讀取其中配置的SQl語句 -->
        <property name="mapperLocations" value="classpath:mybatis/mapper/*.xml" />
    </bean>

定義mapper介面掃描器,配置所有mapper的包路徑,將來由spring+mybatis框架為介面來提供服務(掃描dao層)

   <!-- 4. 定義mapper介面掃描器 配置所有mapper介面所在的包路徑, 將來由Spring + myBatis框架來為介面 提供實現類,
        以及實現類的例項也有Spring框架來建立 -->
    <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
        <!-- 掃描所有XxxMapper介面, 將介面例項的建立交給Spring容器 -->
        <property name="basePackage" value="com.wtu.dao" />
        <!--猜測加上之後,可以通過XxxMappe.xml和XxxMapper.java自動匹配,要在同一個目錄下-->
<!--   <property name="sqlSessionFactoryBeanName" value="sqlSessionFactory"/>-->
    </bean>

配置要掃描的service層的包,spring去自動掃描類,掃描註解(掃描service層)

 <!-- 5.配置需要掃描的包(server層): Spring自動去掃描base-package下的類 如果掃描到的類上有@Controller,@Service,@Component等註解,
        將會自動 將類註冊為bean(即由Spring建立例項) -->
    <context:component-scan base-package="com.wtu.service">
    </context:component-scan>

springmvc-config.xml

配置註解驅動,用於識別註解,比如@[email protected]

<mvc:annotation-driven></mvc:annotation-driven>
<!--這個就相當於做完了處理器對映器和處理器介面卡-->

配置需要去自動掃描的包,sprig就會去自動掃描對應下面的註解

<context:component-scan base-package="com.wtu.controller">
    </context:component-scan>

檢視解析器prefix配置路徑字首,suffix配置檔案字尾

  <bean
            class="org.springframework.web.servlet.view.InternalResourceViewResolver">
        <property name="prefix" value="/WEB-INF/pages/" />
        <property name="suffix" value=".jsp" />
    </bean>

配置靜態資源掃描。對於訪問這個資料夾下面的資源就放行

 <mvc:resources location="/static/" mapping="/static/**" />

mybatis-config.xml

此檔案已經被spring整合了裡面本來應該配置資料鏈接資訊,和資料連線池。然後包這個檔案注入spring中,現在我直接放到了applicationContext中所有這個檔案暫時沒有用

ssm請求流程

首先,1使用者發起請求,

使用者的請求到中央控制器DispatcherServlet,攔截所有請求,

2呼叫處理器對映器找到處理器annotation-driven(這裡通過註解掃描掃描到RequestMapper,通過這個知道請求路徑)

3.返回HandlerExecutionChan(處理器攔截器)看這個請求是否攔截,這個返回到終於控制器

然後返回了一個執行鏈之後對於這個鏈條去執行

4.通過處理器介面卡呼叫具體方法(因為對於請求的引數問題,引數自己匹配啊什麼的,可能還是因為web開發要呼叫到service介面,這個沒有繼承任然可以做到,就是要去適配一下,通過掃描到controller介面然後在去適配的)

5.呼叫具體的Handler(處理器也叫controller控制器)

​ 5.1處理器簡單的分三層架構,controller,service和dao

​ 5.2 Controller(上面所有的請求都是到這一層,然後控制層去呼叫service,服務層,服務層去呼叫dao層)

​ 5.3 controller調service的介面,介面實現類裡面呼叫dao層的介面,dao層通過mybatis去呼叫到對應的xml檔案 裡面的sql語句,然後操作的結果(查詢結果,增刪改等操作成功或失敗等)返回到service

​ 5.4 service這一層如果要對資料進行處理,那麼處理之後就返回給controller

6.controller層最好通過ModelAndView去返回頁面地址和資料給處理器介面卡

7.處理器介面卡把這個ModelAndView返回到中央控制器DispatcherServlet

8.中央控制器DispatcherServlet把這個View給ViewResolver(檢視解析器)

9.ViewResolver(檢視解析器)返回資料給中央控制器DispatcherServlet

10,進行檢視渲染,填充Model等,得到一個完整的View檢視

11.返回把這個檢視返回給使用者

mybatis

放在resource下面,然後可以自動掃描到

<?xml version="1.0" encoding="UTF-8"?>
<!--xml在頭標籤中配置與mybatis層的連線-->
<!DOCTYPE configuration
        PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-config.dtd">
<configuration>
    <environments default="dev">
        <environment id="dev">
            <transactionManager type="JDBC"></transactionManager>
            <!--連結屬性資料-->
            <dataSource type="POOLED">
                <property name="driver" value="com.mysql.jdbc.Driver"/>
                <property name="url" value="jdbc:mysql://localhost:3306/myweb?characterEncoding=utf-8"/>
                <property name="username" value="root"/>
                <property name="password" value="123456"/>
            </dataSource>
        </environment>
    </environments>
    <!--配置對映檔案位置-->
    <mappers>
        <mapper resource="mapper/user.xml"></mapper>
    </mappers>
</configuration>

工具類,建立工廠的,返回session

    public SqlSession openMyBatis(){
        /*確定指令連線物件*/
        SqlSessionFactory sqlSessionFactory;
        /*sqlsession為指令執行物件*/
        SqlSession session=null;
        String resources= "mybatis.xml";
        try {
            InputStream inputStream = Resources.getResourceAsStream(resources);
            /*如果配置檔案正常載入,就開始連線資料庫*/
            sqlSessionFactory =new SqlSessionFactoryBuilder().build(inputStream);
            /*sql指令執行環節session呼叫工具方法,例項化成功
             * 獲取到dao層介面,並例項化*/
            session= sqlSessionFactory.openSession();

        }catch (Exception e){
            e.printStackTrace();
            System.out.println("mybatis例項化失敗");
        }
        return session;
    }
    public static void closeMybatis(SqlSession sqlSession){
        if (sqlSession!=null){
            sqlSession.close();
        }
    }

具體實現類

   public void LoginServlet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        String name = request.getParameter("fAccount");
        String password =request.getParameter("fPassword");
        MybatisConfig mybatisConfig = new MybatisConfig();
        SqlSession session=mybatisConfig.openMyBatis();
        UserDao userDao =session.getMapper(UserDao.class);

        List<Map<String, Object>> list = userDao.selectUserAll();

        for (Map<String, Object> map : list) {
            if (map.get("name").equals(name)&&map.get("password").equals(password)){
                request.setAttribute("msg","看見我就是登入成功");
                request.getRequestDispatcher("/WEB-INF/success.jsp").forward(request,response);
                break;
            }
        }
        request.setAttribute("msg","看見我就是登入失敗,失敗,失敗,重要的事說三遍,滾回去改程式碼去");
        request.getRequestDispatcher("/WEB-INF/failure.jsp").forward(request,response);

    }

呼叫工具類返回session,然後通過session去呼叫getMapper(傳遞介面的位元組碼)所以這個就是呼叫的這個介面的例項化物件

然後在根據這個物件呼叫相應的sql語句,執行sql語句,只需要關注兩點,傳入引數和返回物件

在web專案中,java代表了web的後端開發區域

com.stu.ssm代表了專案的主題包,所有的自保都要在主題包中簡歷

1.base:專案的前端板塊,客戶瀏覽板塊,給網頁瀏覽者檢視的區域板塊,一般不需要賬戶登入,可直接檢視

2.basemanage:專案的後端板塊,管理員運營板塊,有相關盈利機構組織負責人員進行賬號登陸許可權管理,對base客戶瀏覽頁面板塊進行及時的資料文字報道,視訊,音訊,影象,消費品廣告資訊進行上下架更新管理

3.filter:web專案的過濾器,對整套系統安全性方木啊的資料過濾,請求過濾,(後端控制層的)

4.interceptor web專案的攔截器,對訪問jsp及整套html的請求,在訪問到頁面之後,進行結果反彈,重定向登陸頁面

–注意,一般過濾器和攔截器都設定在basemanage後端中–

5.resource,是對整個web專案的spring框架配置xml檔案儲存的空間

6.util自定義工具包