File tree 3 files changed +46
-2
lines changed
java/org/gluecoders/library
3 files changed +46
-2
lines changed Original file line number Diff line number Diff line change 7
7
<groupId >org.gluecoders.guides</groupId >
8
8
<artifactId >springboot-guide</artifactId >
9
9
<version >1.0-SNAPSHOT</version >
10
- <packaging >jar </packaging >
10
+ <packaging >war </packaging >
11
11
<properties >
12
12
<project .build.sourceEncoding>UTF-8</project .build.sourceEncoding>
13
13
<project .reporting.outputEncoding>UTF-8</project .reporting.outputEncoding>
23
23
<version >${spring.version} </version >
24
24
<type >pom</type >
25
25
</dependency >
26
+ <dependency >
27
+ <groupId >org.springframework.boot</groupId >
28
+ <artifactId >spring-boot-starter-tomcat</artifactId >
29
+ <version >${spring.version} </version >
30
+ <scope >provided</scope >
31
+ </dependency >
26
32
<dependency >
27
33
<groupId >org.springframework.boot</groupId >
28
34
<artifactId >spring-boot-starter-web</artifactId >
Original file line number Diff line number Diff line change 2
2
3
3
import org .springframework .boot .SpringApplication ;
4
4
import org .springframework .boot .autoconfigure .SpringBootApplication ;
5
+ import org .springframework .boot .builder .SpringApplicationBuilder ;
6
+ import org .springframework .boot .web .support .SpringBootServletInitializer ;
5
7
6
8
/**
7
9
* Created by Anand_Rajneesh on 6/10/2017.
8
10
*/
9
11
@ SpringBootApplication
10
- public class Application {
12
+ public class Application extends SpringBootServletInitializer {
13
+
14
+ @ Override
15
+ protected SpringApplicationBuilder configure (SpringApplicationBuilder application ) {
16
+ return application .sources (Application .class );
17
+ }
11
18
12
19
public static void main (String [] args ) {
13
20
SpringApplication .run (Application .class , args );
Original file line number Diff line number Diff line change
1
+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2
+ <web-app version =" 2.5" xmlns =" http://java.sun.com/xml/ns/javaee"
3
+ xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
4
+ xsi : schemaLocation =" http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" >
5
+
6
+ <servlet >
7
+ <servlet-name >appServlet</servlet-name >
8
+ <servlet-class >org.springframework.web.servlet.DispatcherServlet</servlet-class >
9
+ <init-param >
10
+ <param-name >contextClass</param-name >
11
+ <param-value >org.springframework.web.context.support.AnnotationConfigWebApplicationContext</param-value >
12
+ </init-param >
13
+ <init-param >
14
+ <param-name >contextConfigLocation</param-name >
15
+ <param-value >org.gluecoders.library.config</param-value >
16
+ </init-param >
17
+ <load-on-startup >1</load-on-startup >
18
+ </servlet >
19
+
20
+ <servlet-mapping >
21
+ <servlet-name >appServlet</servlet-name >
22
+ <url-pattern >/</url-pattern >
23
+ </servlet-mapping >
24
+
25
+ <!-- Disables Servlet Container welcome file handling. Needed for compatibility
26
+ with Servlet 3.0 and Tomcat 7.0 -->
27
+ <welcome-file-list >
28
+ <welcome-file ></welcome-file >
29
+ </welcome-file-list >
30
+
31
+ </web-app >
You can’t perform that action at this time.
0 commit comments