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
f5f41fef
Commit
f5f41fef
authored
Jan 06, 2014
by
Dave Syer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Check that WAR apps work in a container
parent
0610378d
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
19 additions
and
3 deletions
+19
-3
pom.xml
spring-boot-samples/spring-boot-sample-servlet/pom.xml
+1
-0
SampleServletApplication.java
...rc/main/java/sample/servlet/SampleServletApplication.java
+8
-1
WebConfig.java
...al/src/main/java/sample/traditional/config/WebConfig.java
+1
-0
web.xml
...g-boot-sample-traditional/src/main/webapp/WEB-INF/web.xml
+1
-1
SampleWebStaticApplication.java
...c/src/main/java/sample/ui/SampleWebStaticApplication.java
+8
-1
No files found.
spring-boot-samples/spring-boot-sample-servlet/pom.xml
View file @
f5f41fef
...
@@ -12,6 +12,7 @@
...
@@ -12,6 +12,7 @@
<packaging>
war
</packaging>
<packaging>
war
</packaging>
<properties>
<properties>
<main.basedir>
${basedir}/../..
</main.basedir>
<main.basedir>
${basedir}/../..
</main.basedir>
<m2eclipse.wtp.contextRoot>
/
</m2eclipse.wtp.contextRoot>
</properties>
</properties>
<dependencies>
<dependencies>
<dependency>
<dependency>
...
...
spring-boot-samples/spring-boot-sample-servlet/src/main/java/sample/servlet/SampleServletApplication.java
View file @
f5f41fef
...
@@ -26,12 +26,14 @@ import javax.servlet.ServletResponse;
...
@@ -26,12 +26,14 @@ import javax.servlet.ServletResponse;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.EnableAutoConfiguration
;
import
org.springframework.boot.autoconfigure.EnableAutoConfiguration
;
import
org.springframework.boot.builder.SpringApplicationBuilder
;
import
org.springframework.boot.web.SpringBootServletInitializer
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Configuration
;
@Configuration
@Configuration
@EnableAutoConfiguration
@EnableAutoConfiguration
public
class
SampleServletApplication
{
public
class
SampleServletApplication
extends
SpringBootServletInitializer
{
@SuppressWarnings
(
"serial"
)
@SuppressWarnings
(
"serial"
)
@Bean
@Bean
...
@@ -49,5 +51,10 @@ public class SampleServletApplication {
...
@@ -49,5 +51,10 @@ public class SampleServletApplication {
public
static
void
main
(
String
[]
args
)
throws
Exception
{
public
static
void
main
(
String
[]
args
)
throws
Exception
{
SpringApplication
.
run
(
SampleServletApplication
.
class
,
args
);
SpringApplication
.
run
(
SampleServletApplication
.
class
,
args
);
}
}
@Override
protected
SpringApplicationBuilder
configure
(
SpringApplicationBuilder
application
)
{
return
application
.
sources
(
SampleServletApplication
.
class
);
}
}
}
spring-boot-samples/spring-boot-sample-traditional/src/main/java/sample/traditional/config/WebConfig.java
View file @
f5f41fef
...
@@ -45,6 +45,7 @@ public class WebConfig extends WebMvcConfigurerAdapter {
...
@@ -45,6 +45,7 @@ public class WebConfig extends WebMvcConfigurerAdapter {
}
}
@Bean
@Bean
// Only used when running in embedded servlet
public
DispatcherServlet
dispatcherServlet
()
{
public
DispatcherServlet
dispatcherServlet
()
{
return
new
DispatcherServlet
();
return
new
DispatcherServlet
();
}
}
...
...
spring-boot-samples/spring-boot-sample-traditional/src/main/webapp/WEB-INF/web.xml
View file @
f5f41fef
...
@@ -12,7 +12,7 @@
...
@@ -12,7 +12,7 @@
</init-param>
</init-param>
<init-param>
<init-param>
<param-name>
contextConfigLocation
</param-name>
<param-name>
contextConfigLocation
</param-name>
<param-value>
org.springframework.issues
.config
</param-value>
<param-value>
sample.traditional
.config
</param-value>
</init-param>
</init-param>
<load-on-startup>
1
</load-on-startup>
<load-on-startup>
1
</load-on-startup>
</servlet>
</servlet>
...
...
spring-boot-samples/spring-boot-sample-web-static/src/main/java/sample/ui/SampleWebStaticApplication.java
View file @
f5f41fef
...
@@ -18,14 +18,21 @@ package sample.ui;
...
@@ -18,14 +18,21 @@ package sample.ui;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.EnableAutoConfiguration
;
import
org.springframework.boot.autoconfigure.EnableAutoConfiguration
;
import
org.springframework.boot.builder.SpringApplicationBuilder
;
import
org.springframework.boot.web.SpringBootServletInitializer
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Configuration
;
@Configuration
@Configuration
@EnableAutoConfiguration
@EnableAutoConfiguration
public
class
SampleWebStaticApplication
{
public
class
SampleWebStaticApplication
extends
SpringBootServletInitializer
{
public
static
void
main
(
String
[]
args
)
throws
Exception
{
public
static
void
main
(
String
[]
args
)
throws
Exception
{
SpringApplication
.
run
(
SampleWebStaticApplication
.
class
,
args
);
SpringApplication
.
run
(
SampleWebStaticApplication
.
class
,
args
);
}
}
@Override
protected
SpringApplicationBuilder
configure
(
SpringApplicationBuilder
application
)
{
return
application
.
sources
(
SampleWebStaticApplication
.
class
);
}
}
}
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