在SSM架構中匯入jquery基本指令碼庫報沒有找到檔案

來源:互聯網
上載者:User

標籤:解決   display   play   ade   模式   patch   style   方案   org   

1.報錯

2.解決方案:

<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:applicationContext.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>

<!-- 前端控制器 -->
<servlet>
<servlet-name>dispatcher</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>dispatcher</servlet-name>
<url-pattern>/</url-pattern><!-- url匹配模式 -->
</servlet-mapping>



<!-- SprinMVC提供的字元編碼過慮器 -->
<filter>
<filter-name>characterEncodingFilter</filter-name>
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>UTF-8</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>characterEncodingFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>

<!-- 因為被前面的 前端端控制器,SprinMVC提供的字元編碼過慮器攔截了,所以要配置(匹配)的所有js檔案 -->
<servlet-mapping>
<servlet-name>default</servlet-name>
<url-pattern>*.js</url-pattern>
</servlet-mapping>

 

 

3.

 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></display-name>     8    9   <context-param>10       <param-name>contextConfigLocation</param-name>11       <param-value>classpath:applicationContext.xml</param-value>12   </context-param>13   <listener>14       <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>15   </listener>16   17   18   <!-- 請求監聽 --> 19   <!-- <listener>20       <listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>21   </listener> -->22   23   <!-- 前端控制器 -->24   <servlet>25       <servlet-name>dispatcher</servlet-name>26       <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>27     <load-on-startup>1</load-on-startup> 28   </servlet>29   <servlet-mapping>30       <servlet-name>dispatcher</servlet-name>31       <url-pattern>/</url-pattern><!-- url匹配模式 -->32   </servlet-mapping>33    34   35   36   <!-- SprinMVC提供的字元編碼過慮器 -->37   <filter>38       <filter-name>characterEncodingFilter</filter-name>39       <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>40       <init-param>41           <param-name>encoding</param-name>42           <param-value>UTF-8</param-value>43       </init-param>44   </filter>45   <filter-mapping>46       <filter-name>characterEncodingFilter</filter-name>47       <url-pattern>/*</url-pattern>48   </filter-mapping>49   50   <!-- 因為被前面的 前端端控制器,SprinMVC提供的字元編碼過慮器攔截了,所以要配置(匹配)的所有js檔案 -->51   <servlet-mapping>52       <servlet-name>default</servlet-name>53       <url-pattern>*.js</url-pattern>54   </servlet-mapping>55   56   57   <welcome-file-list>58     <welcome-file>index.jsp</welcome-file>59   </welcome-file-list>60 </web-app>

 

在SSM架構中匯入jquery基本指令碼庫報沒有找到檔案

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.