File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2121 </arguments >
2222 </buildCommand >
2323 <buildCommand >
24- <name >org.eclipse.m2e.core.maven2Builder </name >
24+ <name >org.eclipse.wst.validation.validationbuilder </name >
2525 <arguments >
2626 </arguments >
2727 </buildCommand >
2828 <buildCommand >
29- <name >org.eclipse.wst.validation.validationbuilder </name >
29+ <name >org.eclipse.m2e.core.maven2Builder </name >
3030 <arguments >
3131 </arguments >
3232 </buildCommand >
Original file line number Diff line number Diff line change 22<faceted-project >
33 <fixed facet =" wst.jsdt.web" />
44 <installed facet =" java" version =" 1.6" />
5- <installed facet =" jst.web" version =" 2.5" />
65 <installed facet =" wst.jsdt.web" version =" 1.0" />
6+ <installed facet =" jst.web" version =" 3.0" />
77</faceted-project >
Original file line number Diff line number Diff line change 11<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/xsd/maven-4.0.0.xsd" >
22 <modelVersion >4.0.0</modelVersion >
3- <name >rest-ui</name >
43 <artifactId >rest-ui</artifactId >
4+ <packaging >war</packaging >
5+ <name >rest-ui</name >
56
67 <parent >
78 <groupId >org</groupId >
2728 <scope >test</scope >
2829 </dependency >
2930
31+ <!-- web -->
32+ <dependency >
33+ <groupId >javax.servlet</groupId >
34+ <artifactId >javax.servlet-api</artifactId >
35+ <version >3.0.1</version >
36+ <scope >provided</scope >
37+ </dependency >
38+
3039 </dependencies >
3140
3241 <build >
4049 <plugins >
4150
4251 <!-- placeholder -->
43-
52+
4453 </plugins >
4554
4655 </build >
47-
56+
4857 <properties >
49- <!-- <aws-java-sdk.version>1.3.18</aws-java-sdk.version> -->
58+ <!-- -->
5059 </properties >
5160
52- <packaging >war</packaging >
5361</project >
Original file line number Diff line number Diff line change 1+ package org .resthub .todo ;
2+
3+ import javax .servlet .ServletContext ;
4+ import javax .servlet .ServletException ;
5+ import javax .servlet .ServletRegistration ;
6+ import org .springframework .web .WebApplicationInitializer ;
7+ import org .springframework .web .context .ContextLoaderListener ;
8+ import org .springframework .web .context .support .AnnotationConfigWebApplicationContext ;
9+ import org .springframework .web .servlet .DispatcherServlet ;
10+
11+ public class TodoInitializer implements WebApplicationInitializer {
12+
13+ @ Override
14+ public void onStartup (ServletContext servletContext ) throws ServletException {
15+ AnnotationConfigWebApplicationContext rootContext = new AnnotationConfigWebApplicationContext ();
16+ rootContext .register (WebConfig .class );
17+
18+ ServletRegistration .Dynamic dispatcher = servletContext .addServlet ("dispatcher" , new DispatcherServlet (rootContext ));
19+ dispatcher .setLoadOnStartup (1 );
20+ dispatcher .addMapping ("/*" );
21+ servletContext .addListener (new ContextLoaderListener (rootContext ));
22+ }
23+
24+ }
Original file line number Diff line number Diff line change 1+ package org .resthub .todo ;
2+
3+ import org .springframework .context .annotation .ComponentScan ;
4+ import org .springframework .context .annotation .Configuration ;
5+ import org .springframework .web .servlet .config .annotation .EnableWebMvc ;
6+ import org .springframework .web .servlet .config .annotation .ResourceHandlerRegistry ;
7+ import org .springframework .web .servlet .config .annotation .WebMvcConfigurerAdapter ;
8+
9+ @ Configuration
10+ @ EnableWebMvc
11+ @ ComponentScan (basePackages = "org.resthub.todo" )
12+ public class WebConfig extends WebMvcConfigurerAdapter {
13+
14+ @ Override
15+ public void addResourceHandlers (ResourceHandlerRegistry registry ) {
16+ registry .addResourceHandler ("**" ).addResourceLocations ("/" );
17+ }
18+
19+ }
Original file line number Diff line number Diff line change 33xmlns=" http://java.sun.com/xml/ns/javaee" xsi : schemaLocation =" http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
44version=" 3.0" >
55
6- </web-app >
7-
6+ </web-app >
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
You can’t perform that action at this time.
0 commit comments