소스 검색

支持跨域

wushengzong 6 년 전
부모
커밋
3cd69d0c65
4개의 변경된 파일13개의 추가작업 그리고 0개의 파일을 삭제
  1. 5 0
      pom.xml
  2. 8 0
      src/main/webapp/WEB-INF/web.xml
  3. BIN
      src/main/webapp/images/view1.jpg
  4. BIN
      src/main/webapp/images/view2.jpg

+ 5 - 0
pom.xml

@@ -226,6 +226,11 @@
       <version>3.1.0</version>
       <scope>provided</scope>
     </dependency>
+    <dependency>
+      <groupId>org.eclipse.jetty</groupId>
+      <artifactId>jetty-servlets</artifactId>
+      <version>9.4.8.v20171121</version>
+    </dependency>
 
 
     <!--导入JSTL标签库-->

+ 8 - 0
src/main/webapp/WEB-INF/web.xml

@@ -71,5 +71,13 @@
     <filter-name>shiroFilter</filter-name>
     <url-pattern>/*</url-pattern>
   </filter-mapping>-->
+  <filter>
+    <filter-name>cross-origin</filter-name>
+    <filter-class>org.eclipse.jetty.servlets.CrossOriginFilter</filter-class>
+  </filter>
+  <filter-mapping>
+    <filter-name>cross-origin</filter-name>
+    <url-pattern>/*</url-pattern>
+  </filter-mapping>
 
 </web-app>

BIN
src/main/webapp/images/view1.jpg


BIN
src/main/webapp/images/view2.jpg