Skip to content

Commit 69cd041

Browse files
author
eugenp
committed
very early work on UI - nothing done at this point
1 parent 3ef4352 commit 69cd041

10 files changed

Lines changed: 60 additions & 10 deletions

File tree

‎ui/.project‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@
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>

‎ui/.settings/org.eclipse.wst.common.project.facet.core.xml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
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>

‎ui/pom.xml‎

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
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>
@@ -27,6 +28,14 @@
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>
@@ -40,14 +49,13 @@
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>
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
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+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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+
}

‎ui/src/main/resources/web.xml‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,4 @@
33
xmlns="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"
44
version="3.0">
55

6-
</web-app>
7-
6+
</web-app>

0 commit comments

Comments
 (0)