Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nouiWithSpringMVC
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gechengyang
nouiWithSpringMVC
Commits
97e08c89
Commit
97e08c89
authored
Jan 12, 2021
by
WeiCong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加对文件上传类型得限制
parent
1bf77695
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
27 deletions
+43
-27
spring-mvc.xml
src/main/resources/spring-mvc.xml
+43
-27
No files found.
src/main/resources/spring-mvc.xml
View file @
97e08c89
<?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:context=
"http://www.springframework.org/schema/context"
xmlns:mvc=
"http://www.springframework.org/schema/mvc"
xmlns:aop=
"http://www.springframework.org/schema/aop"
xsi:schemaLocation=
"http://www.springframework.org/schema/beans
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xmlns:context=
"http://www.springframework.org/schema/context"
xmlns:mvc=
"http://www.springframework.org/schema/mvc"
xsi:schemaLocation=
"http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd
"
>
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd"
>
<mvc:annotation-driven
/>
<mvc:annotation-driven>
<mvc:message-converters>
<ref
bean=
"stringHttpMessageConverter"
/>
<ref
bean=
"mappingJackson2HttpMessageConverter"
/>
</mvc:message-converters>
</mvc:annotation-driven>
<bean
id=
"stringHttpMessageConverter"
class=
"org.springframework.http.converter.StringHttpMessageConverter"
/>
<!--解决IE浏览器json文件下载和json数据中午乱码的问题-->
<bean
id=
"mappingJackson2HttpMessageConverter"
class=
"org.springframework.http.converter.json.MappingJackson2HttpMessageConverter"
>
<property
name=
"supportedMediaTypes"
>
<list>
<value>
text/html;charset=UTF-8
</value>
</list>
</property>
</bean>
<bean
id=
"multipartResolver"
class=
"org.springframework.web.multipart.commons.CommonsMultipartResolver"
>
<property
name=
"maxUploadSize"
value=
"200000"
/>
<property
name=
"maxInMemorySize"
value=
"200000"
/>
</bean>
<bean
id=
"nouiVersion"
class=
"org.sss.presentation.noui.api.response.NoUiVersion"
>
<property
name=
"version"
value=
"202009091600"
/>
<property
name=
"rootFilePath"
value=
""
/>
</bean>
<mvc:default-servlet-handler
/>
<mvc:interceptors>
<mvc:interceptor>
<mvc:interceptor>
<mvc:mapping
path=
"/**/*"
/>
<bean
class=
"org.sss.presentation.noui.filter.Cors"
/>
</mvc:interceptor>
...
...
@@ -24,30 +50,20 @@
<mvc:mapping
path=
"/**"
/>
<!--login 不需要拦截 -->
<mvc:exclude-mapping
path=
"/login"
/>
<mvc:exclude-mapping
path=
"/getUserByDn"
/>
<mvc:exclude-mapping
path=
"/login/**"
/>
<mvc:exclude-mapping
path=
"/fileBrowser/**"
/
>
<!--<mvc:exclude-mapping path="/fileBrowser/**" />--
>
<bean
class=
"org.sss.presentation.noui.jwt.TokenInterceptor"
></bean>
</mvc:interceptor>
<mvc:interceptor>
<!-- /**表示所有URL和子URL路径 -->
<mvc:mapping
path=
"/**"
/>
<!-- 配置自定义的文件上传类型限制拦截器 -->
<bean
class=
"org.sss.presentation.noui.filter.FileTypeInterceptor"
>
<property
name=
"type_list"
value=
"jpg,gif,png,ico,bmp,jpeg"
/>
</bean>
</mvc:interceptor>
<mvc:interceptor>
<mvc:mapping
path=
"/**"
/>
<bean
class=
"org.sss.presentation.noui.filter.FileTypeInterceptor"
>
<property
name=
"type_list"
value=
"bat,sh,js,sql,exe"
/>
</bean>
</mvc:interceptor>
</mvc:interceptors>
<bean
id=
"multipartResolver"
class=
"org.springframework.web.multipart.commons.CommonsMultipartResolver"
>
<property
name=
"maxUploadSize"
value=
"200000"
/>
<property
name=
"maxInMemorySize"
value=
"200000"
/>
</bean>
<bean
id=
"noUiVersion"
class=
"org.sss.presentation.noui.api.response.NoUiVersion"
>
<property
name=
"version"
value=
"202009091600"
/>
<property
name=
"rootFilePath"
value=
"f:/"
/>
</bean>
<!-- 配置自动扫描的包 -->
<context:component-scan
base-package=
"org.sss.presentation.noui.controller"
></context:component-scan>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment