ssm開發關於web.xml配置

來源:互聯網
上載者:User

標籤:for   loader   frame   file   tar   start   ted   1.0   指定   

 1 <?xml version="1.0" encoding="UTF-8"?> 2 <web-app version="3.0"  3     xmlns="http://java.sun.com/xml/ns/javaee"  4     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  5     xsi:schemaLocation="http://java.sun.com/xml/ns/javaee  6     http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"> 7   <display-name>Archetype Created Web Application</display-name> 8   <welcome-file-list> 9     <welcome-file>/WEB-INF/pages/index.jsp</welcome-file>10   </welcome-file-list>11   <!-- 配置監聽spring-->12   <listener>13       <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>14   </listener>15   <!-- 指定spring bean 的設定檔所在目錄 -->16   <context-param>17       <param-name>contextConfigLocation</param-name>18       <param-value>classpath:applicationContext-*.xml</param-value>19   </context-param>20   21   <!-- 配置spring字元編碼為utf-8 -->22   <filter>23       <filter-name>encodingFilter</filter-name>24       <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>25       <init-param>26           <param-name>encoding</param-name>27           <param-value>UTF-8</param-value>28       </init-param>29       <init-param>30           <param-name>forceEncoding</param-name>31           <param-value>true</param-value>32       </init-param>33   </filter>34   <filter-mapping>35       <filter-name>encodingFilter</filter-name>36       <url-pattern>/*</url-pattern>37   </filter-mapping>38   39   <!-- springMVC的配置 -->40   <servlet>41       <servlet-name>spring</servlet-name>42       <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>43       <init-param>44           <param-name>contextConfigLocation</param-name>45           <param-value>classpath:spring-servlet.xml</param-value>46       </init-param>47       <load-on-startup>1</load-on-startup>48   </servlet>49   <servlet-mapping>50       <servlet-name>spring</servlet-name>51       <url-pattern>/</url-pattern>52   </servlet-mapping>53  54   55   56   <!-- log4j配置 -->57   <context-param>58       <param-name>log4jConfigLocation</param-name>59       <param-value>classpath:log4j.properties</param-value>60   </context-param>61   <context-param>62       <param-name>webAppRootKey</param-name>63       <param-value>SLSaleSystem.root</param-value>64   </context-param>65   <!-- spring載入log4j的監聽 -->66   <listener>67       <listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>68   </listener>69 </web-app>

 

ssm開發關於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.