Skip to content

Commit 669f453

Browse files
initial import
1 parent 31ffd3e commit 669f453

24 files changed

+1066
-0
lines changed

student-services/.classpath

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<classpath>
3+
<classpathentry kind="src" output="target/classes" path="src/main/java">
4+
<attributes>
5+
<attribute name="optional" value="true"/>
6+
<attribute name="maven.pomderived" value="true"/>
7+
</attributes>
8+
</classpathentry>
9+
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
10+
<attributes>
11+
<attribute name="maven.pomderived" value="true"/>
12+
</attributes>
13+
</classpathentry>
14+
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
15+
<attributes>
16+
<attribute name="optional" value="true"/>
17+
<attribute name="maven.pomderived" value="true"/>
18+
</attributes>
19+
</classpathentry>
20+
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
21+
<attributes>
22+
<attribute name="maven.pomderived" value="true"/>
23+
</attributes>
24+
</classpathentry>
25+
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
26+
<attributes>
27+
<attribute name="maven.pomderived" value="true"/>
28+
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
29+
</attributes>
30+
</classpathentry>
31+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7">
32+
<attributes>
33+
<attribute name="maven.pomderived" value="true"/>
34+
</attributes>
35+
</classpathentry>
36+
<classpathentry kind="output" path="target/classes"/>
37+
</classpath>

student-services/.project

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>student-services</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>org.eclipse.wst.jsdt.core.javascriptValidator</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
<buildCommand>
14+
<name>org.eclipse.jdt.core.javabuilder</name>
15+
<arguments>
16+
</arguments>
17+
</buildCommand>
18+
<buildCommand>
19+
<name>org.eclipse.wst.common.project.facet.core.builder</name>
20+
<arguments>
21+
</arguments>
22+
</buildCommand>
23+
<buildCommand>
24+
<name>org.eclipse.wst.validation.validationbuilder</name>
25+
<arguments>
26+
</arguments>
27+
</buildCommand>
28+
<buildCommand>
29+
<name>org.eclipse.m2e.core.maven2Builder</name>
30+
<arguments>
31+
</arguments>
32+
</buildCommand>
33+
</buildSpec>
34+
<natures>
35+
<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
36+
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
37+
<nature>org.eclipse.jdt.core.javanature</nature>
38+
<nature>org.eclipse.m2e.core.maven2Nature</nature>
39+
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
40+
<nature>org.eclipse.wst.jsdt.core.jsNature</nature>
41+
</natures>
42+
</projectDescription>

student-services/.settings/.jsdtscope

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<classpath>
3+
<classpathentry kind="src" path="src/main/webapp"/>
4+
<classpathentry kind="src" path="target/m2e-wtp/web-resources"/>
5+
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.JRE_CONTAINER"/>
6+
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.WebProject">
7+
<attributes>
8+
<attribute name="hide" value="true"/>
9+
</attributes>
10+
</classpathentry>
11+
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.baseBrowserLibrary"/>
12+
<classpathentry kind="output" path=""/>
13+
</classpath>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
eclipse.preferences.version=1
2+
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
3+
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
4+
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
5+
org.eclipse.jdt.core.compiler.compliance=1.7
6+
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
7+
org.eclipse.jdt.core.compiler.debug.localVariable=generate
8+
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
9+
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
10+
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
11+
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
12+
org.eclipse.jdt.core.compiler.source=1.7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
activeProfiles=
2+
eclipse.preferences.version=1
3+
resolveWorkspaceProjects=true
4+
version=1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
2+
<wb-module deploy-name="student-services">
3+
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
4+
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
5+
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
6+
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
7+
<property name="context-root" value="student-services"/>
8+
<property name="java-output-path" value="/student-services/target/classes"/>
9+
</wb-module>
10+
</project-modules>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<root>
2+
<facet id="jst.jaxrs">
3+
<node name="libprov">
4+
<attribute name="provider-id" value="jaxrs-no-op-library-provider"/>
5+
</node>
6+
</facet>
7+
</root>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<faceted-project>
3+
<fixed facet="wst.jsdt.web"/>
4+
<installed facet="wst.jsdt.web" version="1.0"/>
5+
<installed facet="java" version="1.7"/>
6+
<installed facet="jst.jaxrs" version="2.0"/>
7+
<installed facet="jst.web" version="3.1"/>
8+
</faceted-project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
org.eclipse.wst.jsdt.launching.baseBrowserLibrary
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Window
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
disabled=06target
2+
eclipse.preferences.version=1

student-services/pom.xml

+178
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,178 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
<modelVersion>4.0.0</modelVersion>
4+
<groupId>com.pdizzle</groupId>
5+
<artifactId>student-services</artifactId>
6+
<version>1.0.0-SNAPSHOT</version>
7+
<packaging>war</packaging>
8+
<repositories>
9+
<repository>
10+
<id>central</id>
11+
<name>Central Repository</name>
12+
<url>http://repo1.maven.org/maven2</url>
13+
<layout>default</layout>
14+
<snapshots>
15+
<enabled>false</enabled>
16+
</snapshots>
17+
</repository>
18+
</repositories>
19+
20+
<properties>
21+
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
22+
<resteasy.version>3.0.8.Final</resteasy.version>
23+
<spring.version>4.1.0.RELEASE</spring.version>
24+
<logback>1.0.13</logback>
25+
<slf4j>1.7.5</slf4j>
26+
</properties>
27+
28+
<dependencies>
29+
<dependency>
30+
<groupId>org.jboss.resteasy</groupId>
31+
<artifactId>resteasy-spring</artifactId>
32+
<version>${resteasy.version}</version>
33+
</dependency>
34+
<dependency>
35+
<groupId>org.jboss.resteasy</groupId>
36+
<artifactId>resteasy-servlet-initializer</artifactId>
37+
<version>${resteasy.version}</version>
38+
</dependency>
39+
<dependency>
40+
<groupId>org.jboss.resteasy</groupId>
41+
<artifactId>resteasy-jackson-provider</artifactId>
42+
<version>${resteasy.version}</version>
43+
</dependency>
44+
<dependency>
45+
<groupId>org.jboss.resteasy</groupId>
46+
<artifactId>resteasy-client</artifactId>
47+
<version>${resteasy.version}</version>
48+
<scope>test</scope>
49+
</dependency>
50+
<dependency>
51+
<groupId>org.springframework</groupId>
52+
<artifactId>spring-webmvc</artifactId>
53+
<version>${spring.version}</version>
54+
</dependency>
55+
<dependency>
56+
<groupId>org.springframework</groupId>
57+
<artifactId>spring-jdbc</artifactId>
58+
<version>${spring.version}</version>
59+
</dependency>
60+
<dependency>
61+
<groupId>javax.servlet</groupId>
62+
<artifactId>javax.servlet-api</artifactId>
63+
<version>3.1.0</version>
64+
<scope>provided</scope>
65+
</dependency>
66+
<dependency>
67+
<groupId>ch.qos.logback</groupId>
68+
<artifactId>logback-core</artifactId>
69+
<version>${logback}</version>
70+
</dependency>
71+
<dependency>
72+
<groupId>ch.qos.logback</groupId>
73+
<artifactId>logback-classic</artifactId>
74+
<version>${logback}</version>
75+
</dependency>
76+
<dependency>
77+
<groupId>org.slf4j</groupId>
78+
<artifactId>jul-to-slf4j</artifactId>
79+
<version>${slf4j}</version>
80+
</dependency>
81+
<dependency>
82+
<groupId>org.slf4j</groupId>
83+
<artifactId>jcl-over-slf4j</artifactId>
84+
<version>${slf4j}</version>
85+
</dependency>
86+
<dependency>
87+
<groupId>org.apache.tomcat</groupId>
88+
<artifactId>tomcat-jdbc</artifactId>
89+
<version>7.0.55</version>
90+
<scope>compile</scope>
91+
</dependency>
92+
<dependency>
93+
<groupId>org.jasypt</groupId>
94+
<artifactId>jasypt</artifactId>
95+
<version>1.9.2</version>
96+
</dependency>
97+
<dependency>
98+
<groupId>net.sourceforge.jtds</groupId>
99+
<artifactId>jtds</artifactId>
100+
<version>1.3.1</version>
101+
</dependency>
102+
<dependency>
103+
<groupId>org.springframework</groupId>
104+
<artifactId>spring-test</artifactId>
105+
<version>${spring.version}</version>
106+
<scope>test</scope>
107+
</dependency>
108+
<dependency>
109+
<groupId>junit</groupId>
110+
<artifactId>junit</artifactId>
111+
<version>4.11</version>
112+
<scope>test</scope>
113+
</dependency>
114+
</dependencies>
115+
116+
<build>
117+
118+
<plugins>
119+
<plugin>
120+
<artifactId>maven-compiler-plugin</artifactId>
121+
<version>3.1</version>
122+
<configuration>
123+
<target>1.7</target>
124+
<source>1.7</source>
125+
<fork>true</fork>
126+
</configuration>
127+
</plugin>
128+
129+
<plugin>
130+
<artifactId>maven-war-plugin</artifactId>
131+
<version>2.4</version>
132+
<executions>
133+
<execution>
134+
<id>default-war</id>
135+
<phase>package</phase>
136+
<goals>
137+
<goal>war</goal>
138+
</goals>
139+
<configuration>
140+
<manifest>
141+
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
142+
</manifest>
143+
<failOnMissingWebXml>false</failOnMissingWebXml>
144+
</configuration>
145+
</execution>
146+
</executions>
147+
</plugin>
148+
149+
150+
151+
<plugin>
152+
<groupId>org.apache.tomcat.maven</groupId>
153+
<artifactId>tomcat7-maven-plugin</artifactId>
154+
<version>2.2</version>
155+
<dependencies>
156+
<dependency>
157+
<groupId>org.apache.tomcat</groupId>
158+
<artifactId>tomcat-jdbc</artifactId>
159+
<version>7.0.55</version>
160+
<scope>compile</scope>
161+
</dependency>
162+
<dependency>
163+
<groupId>net.sourceforge.jtds</groupId>
164+
<artifactId>jtds</artifactId>
165+
<version>1.3.1</version>
166+
</dependency>
167+
</dependencies>
168+
<configuration>
169+
<path>/</path>
170+
<systemProperties>
171+
<env>${env}</env>
172+
</systemProperties>
173+
</configuration>
174+
</plugin>
175+
</plugins>
176+
</build>
177+
178+
</project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
package com.pdizzle.app;
2+
3+
import java.io.IOException;
4+
import javax.servlet.Filter;
5+
import javax.servlet.FilterChain;
6+
import javax.servlet.FilterConfig;
7+
import javax.servlet.ServletException;
8+
import javax.servlet.ServletRequest;
9+
import javax.servlet.ServletResponse;
10+
import javax.servlet.http.HttpServletResponse;
11+
import org.springframework.stereotype.Component;
12+
13+
/**
14+
* Created a filter to allow javascript to access our rest services.
15+
* @author cdpxpb
16+
*
17+
*/
18+
@Component
19+
public class CorsFilter implements Filter {
20+
21+
public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException {
22+
23+
HttpServletResponse response = (HttpServletResponse) res;
24+
response.setHeader("Access-Control-Allow-Origin", "*");
25+
response.setHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE, PUT");
26+
response.setHeader("Access-Control-Max-Age", "3600");
27+
response.setHeader("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
28+
response.setHeader("Access-Control-Expose-Headers", "Location");
29+
chain.doFilter(req, res);
30+
}
31+
32+
public void init(FilterConfig filterConfig) {}
33+
34+
public void destroy() {}
35+
36+
}

0 commit comments

Comments
 (0)