Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
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
DEMO
spring-boot
Commits
1b3a6d16
Commit
1b3a6d16
authored
Aug 08, 2019
by
Stephane Nicoll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Polish "Configure a temporary directory with Undertow"
See gh-17778
parent
0388f954
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
1 deletion
+32
-1
MultipartAutoConfigurationTests.java
...onfigure/web/servlet/MultipartAutoConfigurationTests.java
+31
-0
UndertowServletWebServerFactory.java
...eb/embedded/undertow/UndertowServletWebServerFactory.java
+1
-1
No files found.
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/MultipartAutoConfigurationTests.java
View file @
1b3a6d16
...
...
@@ -148,6 +148,16 @@ public class MultipartAutoConfigurationTests {
.
isSameAs
(
this
.
context
.
getBean
(
DispatcherServlet
.
class
).
getMultipartResolver
());
}
@Test
public
void
webServerWithNonAbsoluteMultipartLocationUndertowConfiguration
()
{
this
.
context
=
new
AnnotationConfigServletWebServerApplicationContext
(
WebServerWithNonAbsolutePathUndertow
.
class
,
BaseConfiguration
.
class
);
this
.
context
.
getBean
(
MultipartConfigElement
.
class
);
verifyServletWorks
();
assertThat
(
this
.
context
.
getBean
(
StandardServletMultipartResolver
.
class
))
.
isSameAs
(
this
.
context
.
getBean
(
DispatcherServlet
.
class
).
getMultipartResolver
());
}
@Test
public
void
webServerWithMultipartConfigDisabled
()
{
testWebServerWithCustomMultipartConfigEnabledSetting
(
"false"
,
0
);
...
...
@@ -365,6 +375,27 @@ public class MultipartAutoConfigurationTests {
}
@Configuration
@EnableWebMvc
public
static
class
WebServerWithNonAbsolutePathUndertow
{
@Bean
MultipartConfigElement
multipartConfigElement
()
{
return
new
MultipartConfigElement
(
"test/not-absolute"
);
}
@Bean
UndertowServletWebServerFactory
webServerFactory
()
{
return
new
UndertowServletWebServerFactory
();
}
@Bean
WebController
webController
()
{
return
new
WebController
();
}
}
@Configuration
public
static
class
WebServerWithCustomMultipartResolver
{
...
...
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/undertow/UndertowServletWebServerFactory.java
View file @
1b3a6d16
...
...
@@ -259,7 +259,6 @@ public class UndertowServletWebServerFactory extends AbstractServletWebServerFac
deployment
.
setClassLoader
(
getServletClassLoader
());
deployment
.
setContextPath
(
getContextPath
());
deployment
.
setDisplayName
(
getDisplayName
());
deployment
.
setTempDir
(
new
File
(
System
.
getProperty
(
"java.io.tmpdir"
)));
deployment
.
setDeploymentName
(
"spring-boot"
);
if
(
isRegisterDefaultServlet
())
{
deployment
.
addServlet
(
Servlets
.
servlet
(
"default"
,
DefaultServlet
.
class
));
...
...
@@ -267,6 +266,7 @@ public class UndertowServletWebServerFactory extends AbstractServletWebServerFac
configureErrorPages
(
deployment
);
deployment
.
setServletStackTraces
(
ServletStackTraces
.
NONE
);
deployment
.
setResourceManager
(
getDocumentRootResourceManager
());
deployment
.
setTempDir
(
createTempDir
(
"undertow"
));
deployment
.
setEagerFilterInit
(
this
.
eagerInitFilters
);
configureMimeMappings
(
deployment
);
for
(
UndertowDeploymentInfoCustomizer
customizer
:
this
.
deploymentInfoCustomizers
)
{
...
...
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