forked from ntut-ben/ezfit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit de812bd
Showing
2,411 changed files
with
147,114 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<classpath> | ||
<classpathentry kind="src" output="target/classes" path="src/main/java"> | ||
<attributes> | ||
<attribute name="optional" value="true"/> | ||
<attribute name="maven.pomderived" value="true"/> | ||
</attributes> | ||
</classpathentry> | ||
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"> | ||
<attributes> | ||
<attribute name="maven.pomderived" value="true"/> | ||
</attributes> | ||
</classpathentry> | ||
<classpathentry kind="src" output="target/test-classes" path="src/test/java"> | ||
<attributes> | ||
<attribute name="test" value="true"/> | ||
<attribute name="optional" value="true"/> | ||
<attribute name="maven.pomderived" value="true"/> | ||
</attributes> | ||
</classpathentry> | ||
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"> | ||
<attributes> | ||
<attribute name="test" value="true"/> | ||
<attribute name="maven.pomderived" value="true"/> | ||
</attributes> | ||
</classpathentry> | ||
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"> | ||
<attributes> | ||
<attribute name="maven.pomderived" value="true"/> | ||
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/> | ||
</attributes> | ||
</classpathentry> | ||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"> | ||
<attributes> | ||
<attribute name="maven.pomderived" value="true"/> | ||
</attributes> | ||
</classpathentry> | ||
<classpathentry kind="output" path="target/classes"/> | ||
</classpath> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<projectDescription> | ||
<name>ezfit</name> | ||
<comment></comment> | ||
<projects> | ||
</projects> | ||
<buildSpec> | ||
<buildCommand> | ||
<name>org.eclipse.jdt.core.javabuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
<buildCommand> | ||
<name>org.eclipse.wst.common.project.facet.core.builder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
<buildCommand> | ||
<name>org.eclipse.wst.validation.validationbuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
<buildCommand> | ||
<name>org.eclipse.m2e.core.maven2Builder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
<buildCommand> | ||
<name>org.springframework.ide.eclipse.core.springbuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
<buildCommand> | ||
<name>org.springframework.ide.eclipse.boot.validation.springbootbuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
</buildSpec> | ||
<natures> | ||
<nature>org.springframework.ide.eclipse.core.springnature</nature> | ||
<nature>org.eclipse.jem.workbench.JavaEMFNature</nature> | ||
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature> | ||
<nature>org.eclipse.jdt.core.javanature</nature> | ||
<nature>org.eclipse.m2e.core.maven2Nature</nature> | ||
<nature>org.eclipse.wst.common.project.facet.core.nature</nature> | ||
<nature>org.eclipse.wst.jsdt.core.jsNature</nature> | ||
</natures> | ||
</projectDescription> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<classpath> | ||
<classpathentry kind="src" path="src/main/webapp"/> | ||
<classpathentry excluding="**/bower_components/*|**/node_modules/*|**/*.min.js" kind="src" path="target/m2e-wtp/web-resources"/> | ||
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.JRE_CONTAINER"/> | ||
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.WebProject"> | ||
<attributes> | ||
<attribute name="hide" value="true"/> | ||
</attributes> | ||
</classpathentry> | ||
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.baseBrowserLibrary"/> | ||
<classpathentry kind="output" path=""/> | ||
</classpath> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
eclipse.preferences.version=1 | ||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled | ||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 | ||
org.eclipse.jdt.core.compiler.compliance=1.8 | ||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error | ||
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled | ||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error | ||
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning | ||
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore | ||
org.eclipse.jdt.core.compiler.release=disabled | ||
org.eclipse.jdt.core.compiler.source=1.8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
activeProfiles= | ||
eclipse.preferences.version=1 | ||
resolveWorkspaceProjects=true | ||
version=1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0"> | ||
<wb-module deploy-name="ezfit-0.0.1-SNAPSHOT"> | ||
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/> | ||
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/> | ||
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/> | ||
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/> | ||
<property name="context-root" value="ezfit"/> | ||
<property name="java-output-path" value="/ezfit/target/classes"/> | ||
</wb-module> | ||
</project-modules> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<faceted-project> | ||
<fixed facet="wst.jsdt.web"/> | ||
<installed facet="wst.jsdt.web" version="1.0"/> | ||
<installed facet="java" version="1.8"/> | ||
<installed facet="jst.web" version="3.1"/> | ||
</faceted-project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
org.eclipse.wst.jsdt.launching.baseBrowserLibrary |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Window |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
disabled=06target | ||
eclipse.preferences.version=1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<beansProjectDescription> | ||
<version>1</version> | ||
<pluginVersion><![CDATA[3.9.10.201909171046-RELEASE]]></pluginVersion> | ||
<configSuffixes> | ||
<configSuffix><![CDATA[xml]]></configSuffix> | ||
</configSuffixes> | ||
<enableImports><![CDATA[false]]></enableImports> | ||
<configs> | ||
<config>src/main/webapp/WEB-INF/applicationContext.xml</config> | ||
</configs> | ||
<autoconfigs> | ||
</autoconfigs> | ||
<configSets> | ||
</configSets> | ||
</beansProjectDescription> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,142 @@ | ||
<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"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<groupId>ntut.edu.com.java012</groupId> | ||
<artifactId>ezfit</artifactId> | ||
<version>0.0.1-SNAPSHOT</version> | ||
<packaging>war</packaging> | ||
<dependencies> | ||
<dependency> | ||
<groupId>junit</groupId> | ||
<artifactId>junit</artifactId> | ||
<version>4.12</version> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>javax.servlet</groupId> | ||
<artifactId>javax.servlet-api</artifactId> | ||
<version>3.1.0</version> | ||
<scope>provided</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>javax.servlet.jsp</groupId> | ||
<artifactId>javax.servlet.jsp-api</artifactId> | ||
<version>2.3.1</version> | ||
<scope>provided</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>jstl</groupId> | ||
<artifactId>jstl</artifactId> | ||
<version>1.2</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>javax.el</groupId> | ||
<artifactId>el-api</artifactId> | ||
<version>2.2.1-b04</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>mysql</groupId> | ||
<artifactId>mysql-connector-java</artifactId> | ||
<version>8.0.13</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.mchange</groupId> | ||
<artifactId>c3p0</artifactId> | ||
<version>0.9.5.4</version> | ||
</dependency> | ||
<!-- https://mvnrepository.com/artifact/com.microsoft.sqlserver/mssql-jdbc --> | ||
<dependency> | ||
<groupId>com.microsoft.sqlserver</groupId> | ||
<artifactId>mssql-jdbc</artifactId> | ||
<version>6.4.0.jre8</version> | ||
</dependency> | ||
|
||
<!-- Hibernate framework --> | ||
<dependency> | ||
<groupId>org.hibernate</groupId> | ||
<artifactId>hibernate-core</artifactId> | ||
<version>5.4.0.Final</version> | ||
</dependency> | ||
|
||
<!-- Spring FrameWork --> | ||
<dependency> | ||
<groupId>org.springframework</groupId> | ||
<artifactId>spring-context</artifactId> | ||
<version>5.2.0.RELEASE</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework</groupId> | ||
<artifactId>spring-web</artifactId> | ||
<version>5.2.0.RELEASE</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework</groupId> | ||
<artifactId>spring-webmvc</artifactId> | ||
<version>5.2.0.RELEASE</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework</groupId> | ||
<artifactId>spring-jdbc</artifactId> | ||
<version>5.2.0.RELEASE</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework</groupId> | ||
<artifactId>spring-tx</artifactId> | ||
<version>5.2.0.RELEASE</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework</groupId> | ||
<artifactId>spring-orm</artifactId> | ||
<version>5.2.0.RELEASE</version> | ||
</dependency> | ||
<!-- JDK 9 之後要加入下列四個<dependency> --> | ||
<dependency> | ||
<groupId>javax.xml.bind</groupId> | ||
<artifactId>jaxb-api</artifactId> | ||
<version>2.2.11</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.sun.xml.bind</groupId> | ||
<artifactId>jaxb-core</artifactId> | ||
<version>2.2.11</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.sun.xml.bind</groupId> | ||
<artifactId>jaxb-impl</artifactId> | ||
<version>2.2.11</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>javax.activation</groupId> | ||
<artifactId>activation</artifactId> | ||
<version>1.1.1</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.google.code.gson</groupId> | ||
<artifactId>gson</artifactId> | ||
<version>2.8.5</version> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.json</groupId> | ||
<artifactId>json</artifactId> | ||
<version>20190722</version> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>com.fasterxml.jackson.core</groupId> | ||
<artifactId>jackson-databind</artifactId> | ||
<version>2.9.9.3</version> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>javax.mail</groupId> | ||
<artifactId>mail</artifactId> | ||
<version>1.4.7</version> | ||
</dependency> | ||
</dependencies> | ||
<properties> | ||
<maven.compiler.target>1.8</maven.compiler.target> | ||
<maven.compiler.source>1.8</maven.compiler.source> | ||
</properties> | ||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
package _00.filter; | ||
|
||
import java.io.IOException; | ||
|
||
import javax.servlet.Filter; | ||
import javax.servlet.FilterChain; | ||
import javax.servlet.FilterConfig; | ||
import javax.servlet.ServletException; | ||
import javax.servlet.ServletRequest; | ||
import javax.servlet.ServletResponse; | ||
import javax.servlet.annotation.WebFilter; | ||
|
||
import org.hibernate.Session; | ||
import org.hibernate.SessionFactory; | ||
import org.hibernate.Transaction; | ||
|
||
import _00.utils.HibernateUtils; | ||
|
||
/** | ||
* Servlet Filter implementation class ServiceController | ||
*/ | ||
@WebFilter({ "/ListIngredient.do", "/MemberLogin.do", "/ShopCart.do", "/CheckShopCart.do", "/login/loginServlet.do", | ||
"/OrderProcess.do", "/MealBox.do","/PlaneProductRetrieve.do" }) | ||
public class ServiceController implements Filter { | ||
|
||
SessionFactory factory; | ||
|
||
public ServiceController() { | ||
|
||
} | ||
|
||
public void destroy() { | ||
} | ||
|
||
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) | ||
throws IOException, ServletException { | ||
Session session = factory.getCurrentSession(); | ||
Transaction tx = null; | ||
try { | ||
tx = session.beginTransaction(); | ||
chain.doFilter(request, response); | ||
tx.commit(); | ||
} catch (Exception e) { | ||
if (tx != null) { | ||
tx.rollback(); | ||
} | ||
e.printStackTrace(); | ||
throw new RuntimeException(e); | ||
} | ||
} | ||
|
||
public void init(FilterConfig fConfig) throws ServletException { | ||
factory = HibernateUtils.getSessionFactory(); | ||
} | ||
|
||
} |
Oops, something went wrong.