SSM商城系統開發筆記-配置01-web.xml

來源:互聯網
上載者:User

標籤:welcome   配置   pre   color   slf4j   mybatis   span   --   針對   

先佔坑 慢慢填,

商城系統使用主體架構:Spring + Spring MVC + Mybatis

其他架構:

 日誌: slf4j + logback

 

 

<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd" ><!--xml 3.1--><web-app  xmlns="http://xmlns.jcp.org/xml/ns/javaee"          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"          xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"          version="3.1"> <!-- 使用3.1版本 注意在pom.xml中更改依賴 -->  <!-- servlet 預設靜態資源 過濾器設定 -->  <servlet-mapping>    <servlet-name>default</servlet-name>    <url-pattern>*.js</url-pattern>  </servlet-mapping><!--******略去餘下部分******-->  <!--    配置SpringMVC 需要配置的檔案    spring-*.xml    spring-dao.xml  spring-service.xml  spring-web.xml    Mybites         spring              springMvc-->  <servlet>    <servlet-name>spring-mvc</servlet-name>    <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>    <init-param>      <param-name>contextConfigLocation</param-name>      <param-value>classpath:spring/spring-*.xml</param-value>    </init-param>  </servlet>  <servlet-mapping>    <servlet-name>spring-mvc</servlet-name>    <!-- ‘/‘ 預設匹配所有請求-->    <url-pattern>/</url-pattern>  </servlet-mapping>  <!-- Spring 字元集過濾器 -->  <filter>    <filter-name>encodingFilter</filter-name>    <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>    <!--字元集設定為 utf-8-->    <init-param>      <param-name>encoding</param-name>      <param-value>UTF-8</param-value>    </init-param>    <!--        設定應用情境        flase只針對request做字元轉換        true對request、response都做字元轉換    -->    <init-param>      <param-name>forceEncoding</param-name>      <param-value>true</param-value>    </init-param>  </filter>  <filter-mapping>    <filter-name>encodingFilter</filter-name>    <url-pattern>/*</url-pattern>  </filter-mapping>  <welcome-file-list>    <welcome-file>index.html</welcome-file>  </welcome-file-list></web-app> 

 

SSM商城系統開發筆記-配置01-web.xml

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.