Skip to content

Commit 73591e4

Browse files
committed
first commit
0 parents  commit 73591e4

27 files changed

+565
-0
lines changed

.classpath

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
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 kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
21+
<attributes>
22+
<attribute name="maven.pomderived" value="true"/>
23+
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
24+
</attributes>
25+
</classpathentry>
26+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
27+
<attributes>
28+
<attribute name="maven.pomderived" value="true"/>
29+
</attributes>
30+
</classpathentry>
31+
<classpathentry kind="con" path="org.eclipse.jst.server.core.container/org.eclipse.jst.server.tomcat.runtimeTarget/Apache Tomcat v8.0"/>
32+
<classpathentry kind="output" path="target/classes"/>
33+
</classpath>

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/target/

.project

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>SpringMybatisSpringMVC</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.springframework.ide.eclipse.core.springbuilder</name>
30+
<arguments>
31+
</arguments>
32+
</buildCommand>
33+
<buildCommand>
34+
<name>org.eclipse.m2e.core.maven2Builder</name>
35+
<arguments>
36+
</arguments>
37+
</buildCommand>
38+
</buildSpec>
39+
<natures>
40+
<nature>org.springframework.ide.eclipse.core.springnature</nature>
41+
<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
42+
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
43+
<nature>org.eclipse.jdt.core.javanature</nature>
44+
<nature>org.eclipse.m2e.core.maven2Nature</nature>
45+
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
46+
<nature>org.eclipse.wst.jsdt.core.jsNature</nature>
47+
</natures>
48+
</projectDescription>

.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 excluding="**/bower_components/*|**/node_modules/*|**/*.min.js" 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>

.settings/org.eclipse.jdt.core.prefs

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
eclipse.preferences.version=1
2+
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
3+
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
4+
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
5+
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
6+
org.eclipse.jdt.core.compiler.compliance=1.8
7+
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
8+
org.eclipse.jdt.core.compiler.debug.localVariable=generate
9+
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
10+
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
11+
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
12+
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
13+
org.eclipse.jdt.core.compiler.source=1.8

.settings/org.eclipse.m2e.core.prefs

+4
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
+10
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="SpringMybatisSpringMVC">
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="SpringMybatisSpringMVC"/>
8+
<property name="java-output-path" value="/SpringMybatisSpringMVC/target/classes"/>
9+
</wb-module>
10+
</project-modules>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
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+
<facet id="jst.jsf">
8+
<node name="libprov">
9+
<attribute name="provider-id" value="jsf-no-op-library-provider"/>
10+
</node>
11+
</facet>
12+
</root>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<faceted-project>
3+
<fixed facet="wst.jsdt.web"/>
4+
<installed facet="jst.web" version="3.0"/>
5+
<installed facet="wst.jsdt.web" version="1.0"/>
6+
<installed facet="java" version="1.8"/>
7+
<installed facet="jst.jaxrs" version="2.0"/>
8+
<installed facet="jst.jsf" version="2.2"/>
9+
</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
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/META-INF/

pom.xml

+143
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
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/maven-v4_0_0.xsd">
3+
<modelVersion>4.0.0</modelVersion>
4+
<groupId>com.hand</groupId>
5+
<artifactId>SpringMybatisSpringMVC</artifactId>
6+
<packaging>war</packaging>
7+
<version>0.0.1-SNAPSHOT</version>
8+
<name>SpringMybatisSpringMVC Maven Webapp</name>
9+
<url>http://maven.apache.org</url>
10+
11+
<properties>
12+
<spring.version>4.3.3.RELEASE</spring.version>
13+
<mybatis.version>3.4.1</mybatis.version>
14+
</properties>
15+
16+
<dependencies>
17+
<dependency>
18+
<groupId>junit</groupId>
19+
<artifactId>junit</artifactId>
20+
<version>3.8.1</version>
21+
<scope>test</scope>
22+
</dependency>
23+
<!-- spring核心包 -->
24+
<dependency>
25+
<groupId>org.springframework</groupId>
26+
<artifactId>spring-core</artifactId>
27+
<version>${spring.version}</version>
28+
</dependency>
29+
30+
<dependency>
31+
<groupId>org.springframework</groupId>
32+
<artifactId>spring-web</artifactId>
33+
<version>${spring.version}</version>
34+
</dependency>
35+
<dependency>
36+
<groupId>org.springframework</groupId>
37+
<artifactId>spring-oxm</artifactId>
38+
<version>${spring.version}</version>
39+
</dependency>
40+
<dependency>
41+
<groupId>org.springframework</groupId>
42+
<artifactId>spring-tx</artifactId>
43+
<version>${spring.version}</version>
44+
</dependency>
45+
46+
<dependency>
47+
<groupId>org.springframework</groupId>
48+
<artifactId>spring-jdbc</artifactId>
49+
<version>${spring.version}</version>
50+
</dependency>
51+
52+
<dependency>
53+
<groupId>org.springframework</groupId>
54+
<artifactId>spring-webmvc</artifactId>
55+
<version>${spring.version}</version>
56+
</dependency>
57+
<dependency>
58+
<groupId>org.springframework</groupId>
59+
<artifactId>spring-aop</artifactId>
60+
<version>${spring.version}</version>
61+
</dependency>
62+
63+
<dependency>
64+
<groupId>org.springframework</groupId>
65+
<artifactId>spring-context</artifactId>
66+
<version>4.3.3.RELEASE</version>
67+
</dependency>
68+
69+
<dependency>
70+
<groupId>org.springframework</groupId>
71+
<artifactId>spring-test</artifactId>
72+
<version>${spring.version}</version>
73+
</dependency>
74+
<!-- mybatis核心包 -->
75+
<dependency>
76+
<groupId>org.mybatis</groupId>
77+
<artifactId>mybatis</artifactId>
78+
<version>${mybatis.version}</version>
79+
</dependency>
80+
<!-- mybatis/spring包 -->
81+
<dependency>
82+
<groupId>org.mybatis</groupId>
83+
<artifactId>mybatis-spring</artifactId>
84+
<version>1.3.1</version>
85+
</dependency>
86+
<!-- 导入java ee jar 包 -->
87+
<dependency>
88+
<groupId>javax</groupId>
89+
<artifactId>javaee-api</artifactId>
90+
<version>7.0</version>
91+
</dependency>
92+
<!-- 导入Mysql数据库链接jar包 -->
93+
<dependency>
94+
<groupId>mysql</groupId>
95+
<artifactId>mysql-connector-java</artifactId>
96+
<version>5.1.30</version>
97+
</dependency>
98+
<!-- 导入dbcp的jar包,用来在applicationContext.xml中配置数据库 -->
99+
<dependency>
100+
<groupId>commons-dbcp</groupId>
101+
<artifactId>commons-dbcp</artifactId>
102+
<version>1.4</version>
103+
</dependency>
104+
<!-- JSTL标签类 -->
105+
<dependency>
106+
<groupId>jstl</groupId>
107+
<artifactId>jstl</artifactId>
108+
<version>1.2</version>
109+
</dependency>
110+
111+
<dependency>
112+
<groupId>commons-io</groupId>
113+
<artifactId>commons-io</artifactId>
114+
<version>2.4</version>
115+
</dependency>
116+
<dependency>
117+
<groupId>commons-codec</groupId>
118+
<artifactId>commons-codec</artifactId>
119+
<version>1.9</version>
120+
</dependency>
121+
<dependency>
122+
<groupId>com.mchange</groupId>
123+
<artifactId>c3p0</artifactId>
124+
<version>0.9.5.2</version>
125+
</dependency>
126+
127+
</dependencies>
128+
<build>
129+
<finalName>SpringMybatisSpringMVC</finalName>
130+
<plugins>
131+
<plugin>
132+
<groupId>org.apache.maven.plugins</groupId>
133+
<artifactId>maven-compiler-plugin</artifactId>
134+
<version>3.3</version>
135+
<configuration>
136+
<!-- 指定source和target的版本 -->
137+
<source>1.8</source>
138+
<target>1.8</target>
139+
</configuration>
140+
</plugin>
141+
</plugins>
142+
</build>
143+
</project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
package com.hand.ssm.controller;
2+
3+
import javax.servlet.http.HttpServletRequest;
4+
import javax.servlet.http.HttpServletResponse;
5+
6+
import org.springframework.beans.factory.annotation.Autowired;
7+
import org.springframework.stereotype.Controller;
8+
import org.springframework.web.bind.annotation.RequestMapping;
9+
import org.springframework.web.servlet.ModelAndView;
10+
11+
import com.hand.ssm.dao.GoodsDao;
12+
import com.hand.ssm.dto.Goods;
13+
14+
@Controller
15+
public class GoodsController {
16+
17+
@Autowired
18+
GoodsDao goodsDao;
19+
20+
@RequestMapping("/good")
21+
public String getGood(ModelAndView modelAndView, HttpServletRequest request, HttpServletResponse response){
22+
long id = Long.valueOf(request.getParameter("id"));
23+
24+
Goods goods = goodsDao.getGoodByPrimaryKey(id);
25+
modelAndView.addObject("good", goods);
26+
return "success";
27+
}
28+
29+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
package com.hand.ssm.dao;
2+
3+
import com.hand.ssm.dto.Goods;
4+
5+
public interface GoodsDao {
6+
7+
Goods getGoodByPrimaryKey(long goodId);
8+
9+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
3+
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
4+
<mapper namespace="com.hand.ssm.dao.GoodsDao">
5+
<select id="getGoodByPrimaryKey" parameterType="com.hand.ssm.dto.Goods" resultType="com.hand.ssm.dto.Goods">
6+
select * from goods where id = #{id}
7+
</select>
8+
</mapper>

0 commit comments

Comments
 (0)