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
5392c0a5
Commit
5392c0a5
authored
Oct 16, 2015
by
Phillip Webb
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'springsource/1.2.x'
parents
7e99d084
c804299c
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
169 additions
and
9 deletions
+169
-9
pom.xml
spring-boot-samples/pom.xml
+1
-0
pom.xml
spring-boot-samples/spring-boot-sample-war/pom.xml
+86
-0
MyController.java
...oot-sample-war/src/main/java/sample/war/MyController.java
+30
-0
SampleWarApplication.java
...le-war/src/main/java/sample/war/SampleWarApplication.java
+33
-0
webapp.txt
...samples/spring-boot-sample-war/src/main/webapp/webapp.txt
+1
-0
AbstractEmbeddedServletContainerFactory.java
...ext/embedded/AbstractEmbeddedServletContainerFactory.java
+4
-4
UndertowEmbeddedServletContainerFactory.java
...ded/undertow/UndertowEmbeddedServletContainerFactory.java
+3
-5
AbstractEmbeddedServletContainerFactoryTests.java
...mbedded/AbstractEmbeddedServletContainerFactoryTests.java
+11
-0
No files found.
spring-boot-samples/pom.xml
View file @
5392c0a5
...
@@ -87,6 +87,7 @@
...
@@ -87,6 +87,7 @@
<module>
spring-boot-sample-undertow
</module>
<module>
spring-boot-sample-undertow
</module>
<module>
spring-boot-sample-undertow-ssl
</module>
<module>
spring-boot-sample-undertow-ssl
</module>
<module>
spring-boot-sample-velocity
</module>
<module>
spring-boot-sample-velocity
</module>
<module>
spring-boot-sample-war
</module>
<module>
spring-boot-sample-web-freemarker
</module>
<module>
spring-boot-sample-web-freemarker
</module>
<module>
spring-boot-sample-web-groovy-templates
</module>
<module>
spring-boot-sample-web-groovy-templates
</module>
<module>
spring-boot-sample-web-method-security
</module>
<module>
spring-boot-sample-web-method-security
</module>
...
...
spring-boot-samples/spring-boot-sample-war/pom.xml
0 → 100644
View file @
5392c0a5
<?xml version="1.0" encoding="UTF-8"?>
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"
>
<modelVersion>
4.0.0
</modelVersion>
<parent>
<!-- Your own application should inherit from spring-boot-starter-parent -->
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-samples
</artifactId>
<version>
1.2.7.BUILD-SNAPSHOT
</version>
</parent>
<artifactId>
spring-boot-sample-war
</artifactId>
<packaging>
war
</packaging>
<name>
Spring Boot War Sample
</name>
<description>
Spring Boot War Sample
</description>
<url>
http://projects.spring.io/spring-boot/
</url>
<organization>
<name>
Pivotal Software, Inc.
</name>
<url>
http://www.spring.io
</url>
</organization>
<properties>
<main.basedir>
${basedir}/../..
</main.basedir>
<m2eclipse.wtp.contextRoot>
/
</m2eclipse.wtp.contextRoot>
</properties>
<dependencies>
<!-- Compile -->
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter
</artifactId>
</dependency>
<dependency>
<groupId>
javax.servlet
</groupId>
<artifactId>
javax.servlet-api
</artifactId>
<scope>
provided
</scope>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-web
</artifactId>
<exclusions>
<exclusion>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-tomcat
</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-maven-plugin
</artifactId>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>
tomcat
</id>
<dependencies>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-tomcat
</artifactId>
<scope>
provided
</scope>
</dependency>
</dependencies>
</profile>
<profile>
<id>
jetty
</id>
<dependencies>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-jetty
</artifactId>
<scope>
provided
</scope>
</dependency>
</dependencies>
</profile>
<profile>
<id>
undertow
</id>
<dependencies>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-undertow
</artifactId>
<scope>
provided
</scope>
</dependency>
</dependencies>
</profile>
</profiles>
</project>
spring-boot-samples/spring-boot-sample-war/src/main/java/sample/war/MyController.java
0 → 100644
View file @
5392c0a5
/*
* Copyright 2012-2015 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
sample
.
war
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
@RestController
public
class
MyController
{
@RequestMapping
(
"/"
)
public
String
hello
()
{
return
"Hello World!"
;
}
}
spring-boot-samples/spring-boot-sample-war/src/main/java/sample/war/SampleWarApplication.java
0 → 100644
View file @
5392c0a5
/*
* Copyright 2012-2015 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
sample
.
war
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.boot.context.web.SpringBootServletInitializer
;
/**
* Sample WAR application
*/
@SpringBootApplication
public
class
SampleWarApplication
extends
SpringBootServletInitializer
{
public
static
void
main
(
String
[]
args
)
{
SpringApplication
.
run
(
SampleWarApplication
.
class
,
args
);
}
}
spring-boot-samples/spring-boot-sample-war/src/main/webapp/webapp.txt
0 → 100644
View file @
5392c0a5
Hello WebApp
spring-boot/src/main/java/org/springframework/boot/context/embedded/AbstractEmbeddedServletContainerFactory.java
View file @
5392c0a5
...
@@ -95,6 +95,10 @@ public abstract class AbstractEmbeddedServletContainerFactory
...
@@ -95,6 +95,10 @@ public abstract class AbstractEmbeddedServletContainerFactory
return
null
;
return
null
;
}
}
private
File
getWarFileDocumentRoot
()
{
return
getArchiveFileDocumentRoot
(
".war"
);
}
private
File
getArchiveFileDocumentRoot
(
String
extension
)
{
private
File
getArchiveFileDocumentRoot
(
String
extension
)
{
File
file
=
getCodeSourceArchive
();
File
file
=
getCodeSourceArchive
();
if
(
this
.
logger
.
isDebugEnabled
())
{
if
(
this
.
logger
.
isDebugEnabled
())
{
...
@@ -107,10 +111,6 @@ public abstract class AbstractEmbeddedServletContainerFactory
...
@@ -107,10 +111,6 @@ public abstract class AbstractEmbeddedServletContainerFactory
return
null
;
return
null
;
}
}
private
File
getWarFileDocumentRoot
()
{
return
getArchiveFileDocumentRoot
(
".war"
);
}
private
File
getCommonDocumentRoot
()
{
private
File
getCommonDocumentRoot
()
{
for
(
String
commonDocRoot
:
COMMON_DOC_ROOTS
)
{
for
(
String
commonDocRoot
:
COMMON_DOC_ROOTS
)
{
File
root
=
new
File
(
commonDocRoot
);
File
root
=
new
File
(
commonDocRoot
);
...
...
spring-boot/src/main/java/org/springframework/boot/context/embedded/undertow/UndertowEmbeddedServletContainerFactory.java
View file @
5392c0a5
...
@@ -64,7 +64,6 @@ import io.undertow.server.HttpHandler;
...
@@ -64,7 +64,6 @@ import io.undertow.server.HttpHandler;
import
io.undertow.server.handlers.accesslog.AccessLogHandler
;
import
io.undertow.server.handlers.accesslog.AccessLogHandler
;
import
io.undertow.server.handlers.accesslog.AccessLogReceiver
;
import
io.undertow.server.handlers.accesslog.AccessLogReceiver
;
import
io.undertow.server.handlers.accesslog.DefaultAccessLogReceiver
;
import
io.undertow.server.handlers.accesslog.DefaultAccessLogReceiver
;
import
io.undertow.server.handlers.resource.ClassPathResourceManager
;
import
io.undertow.server.handlers.resource.FileResourceManager
;
import
io.undertow.server.handlers.resource.FileResourceManager
;
import
io.undertow.server.handlers.resource.Resource
;
import
io.undertow.server.handlers.resource.Resource
;
import
io.undertow.server.handlers.resource.ResourceChangeListener
;
import
io.undertow.server.handlers.resource.ResourceChangeListener
;
...
@@ -372,10 +371,12 @@ public class UndertowEmbeddedServletContainerFactory
...
@@ -372,10 +371,12 @@ public class UndertowEmbeddedServletContainerFactory
private
void
configureAccessLog
(
DeploymentInfo
deploymentInfo
)
{
private
void
configureAccessLog
(
DeploymentInfo
deploymentInfo
)
{
deploymentInfo
.
addInitialHandlerChainWrapper
(
new
HandlerWrapper
()
{
deploymentInfo
.
addInitialHandlerChainWrapper
(
new
HandlerWrapper
()
{
@Override
@Override
public
HttpHandler
wrap
(
HttpHandler
handler
)
{
public
HttpHandler
wrap
(
HttpHandler
handler
)
{
return
createAccessLogHandler
(
handler
);
return
createAccessLogHandler
(
handler
);
}
}
});
});
}
}
...
@@ -433,10 +434,7 @@ public class UndertowEmbeddedServletContainerFactory
...
@@ -433,10 +434,7 @@ public class UndertowEmbeddedServletContainerFactory
if
(
root
!=
null
&&
root
.
isFile
())
{
if
(
root
!=
null
&&
root
.
isFile
())
{
return
new
JarResourcemanager
(
root
);
return
new
JarResourcemanager
(
root
);
}
}
if
(
this
.
resourceLoader
!=
null
)
{
return
ResourceManager
.
EMPTY_RESOURCE_MANAGER
;
return
new
ClassPathResourceManager
(
this
.
resourceLoader
.
getClassLoader
(),
""
);
}
return
new
ClassPathResourceManager
(
getClass
().
getClassLoader
(),
""
);
}
}
private
void
configureErrorPages
(
DeploymentInfo
servletBuilder
)
{
private
void
configureErrorPages
(
DeploymentInfo
servletBuilder
)
{
...
...
spring-boot/src/test/java/org/springframework/boot/context/embedded/AbstractEmbeddedServletContainerFactoryTests.java
View file @
5392c0a5
...
@@ -513,6 +513,17 @@ public abstract class AbstractEmbeddedServletContainerFactoryTests {
...
@@ -513,6 +513,17 @@ public abstract class AbstractEmbeddedServletContainerFactoryTests {
assertThat
(
getJspServlet
(),
is
(
nullValue
()));
assertThat
(
getJspServlet
(),
is
(
nullValue
()));
}
}
@Test
public
void
cannotReadClassPathFiles
()
throws
Exception
{
AbstractEmbeddedServletContainerFactory
factory
=
getFactory
();
this
.
container
=
factory
.
getEmbeddedServletContainer
(
exampleServletRegistration
());
this
.
container
.
start
();
ClientHttpResponse
response
=
getClientResponse
(
getLocalUrl
(
"/org/springframework/boot/SpringApplication.class"
));
assertThat
(
response
.
getStatusCode
(),
equalTo
(
HttpStatus
.
NOT_FOUND
));
}
private
Ssl
getSsl
(
ClientAuth
clientAuth
,
String
keyPassword
,
String
keyStore
)
{
private
Ssl
getSsl
(
ClientAuth
clientAuth
,
String
keyPassword
,
String
keyStore
)
{
return
getSsl
(
clientAuth
,
keyPassword
,
keyStore
,
null
);
return
getSsl
(
clientAuth
,
keyPassword
,
keyStore
,
null
);
}
}
...
...
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