当前位置: 代码迷 >> VC/MFC >> 《基于诠注的SpringMVC增删改DEMO源码》Maven版
  详细解决方案

《基于诠注的SpringMVC增删改DEMO源码》Maven版

热度:198   发布时间:2016-05-02 03:53:50.0
《基于注解的SpringMVC增删改DEMO源码》Maven版
原文地址:
基于注解的Spring mvc增删改DEMO源码
http://tiantiankaixin.iteye.com/blog/2233743

Maven
1,改造成Maven工程后的pom.xml文件
<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/maven-v4_0_0.xsd">    <modelVersion>4.0.0</modelVersion>    <groupId>com.coderdream</groupId>    <artifactId>spring-mvc-crud</artifactId>    <packaging>war</packaging>    <version>0.0.1-SNAPSHOT</version>    <name>spring-mvc-crud Maven Webapp</name>    <url>http://maven.apache.org</url>    <properties>        <commons-lang.version>2.6</commons-lang.version>        <slf4j.version>1.7.6</slf4j.version>        <spring.version>3.2.12.RELEASE</spring.version>        <jackson.version>2.5.4</jackson.version>        <servlet.api.version>2.5</servlet.api.version>        <jsp.api.version>2.1</jsp.api.version>        <hibernate.version>3.6.9.Final</hibernate.version>        <mysql.version>5.1.17</mysql.version>    </properties>    <dependencies>        <dependency>            <groupId>org.springframework</groupId>            <artifactId>spring-web</artifactId>            <version>${spring.version}</version>        </dependency>        <dependency>            <groupId>org.springframework</groupId>            <artifactId>spring-webmvc</artifactId>            <version>${spring.version}</version>        </dependency>        <dependency>            <groupId>commons-lang</groupId>            <artifactId>commons-lang</artifactId>            <version>${commons-lang.version}</version>        </dependency>        <dependency>            <groupId>commons-fileupload</groupId>            <artifactId>commons-fileupload</artifactId>            <version>1.3.1</version>        </dependency>        <dependency>            <groupId>jstl</groupId>            <artifactId>jstl</artifactId>            <version>1.2</version>        </dependency>        <dependency>            <groupId>org.slf4j</groupId>            <artifactId>slf4j-log4j12</artifactId>            <version>${slf4j.version}</version>            <exclusions>                <exclusion>                    <artifactId>slf4j-api</artifactId>                    <groupId>org.slf4j</groupId>                </exclusion>            </exclusions>        </dependency>        <dependency>            <groupId>org.slf4j</groupId>            <artifactId>slf4j-api</artifactId>            <version>${slf4j.version}</version>        </dependency>        <dependency>            <groupId>javax.servlet</groupId>            <artifactId>servlet-api</artifactId>            <version>2.5</version>            <scope>provided</scope>        </dependency>        <!-- 编译的时候用到,打包的时候没有 -->        <dependency>            <groupId>javax.servlet.jsp</groupId>            <artifactId>jsp-api</artifactId>            <version>${jsp.api.version}</version>            <scope>provided</scope>        </dependency>        <!-- hibernate -->        <dependency>            <groupId>org.hibernate</groupId>            <artifactId>hibernate-core</artifactId>            <version>${hibernate.version}</version>            <scope>compile</scope>        </dependency>        <!-- spring-orm for Dao layer -->        <dependency>            <groupId>org.springframework</groupId>            <artifactId>spring-orm</artifactId>            <version>${spring.version}</version>            <scope>compile</scope>        </dependency>        <dependency>            <groupId>org.springframework</groupId>            <artifactId>spring-aspects</artifactId>            <version>${spring.version}</version>        </dependency>        <dependency>            <groupId>org.aspectj</groupId>            <artifactId>aspectjrt</artifactId>            <version>1.8.6</version>        </dependency>        <dependency>            <groupId>org.aspectj</groupId>            <artifactId>aspectjweaver</artifactId>            <version>1.8.6</version>        </dependency>        <!-- mysql connector 数据库驱动 -->        <dependency>            <groupId>mysql</groupId>            <artifactId>mysql-connector-java</artifactId>            <version>${mysql.version}</version>            <scope>compile</scope>        </dependency>        <dependency>            <groupId>org.javassist</groupId>            <artifactId>javassist</artifactId>            <version>3.20.0-GA</version>        </dependency>    </dependencies>    <build>        <finalName>spring-mvc-crud</finalName>        <plugins>            <plugin>                <groupId>org.eclipse.jetty</groupId>                <artifactId>                jetty-maven-plugin</artifactId>                <version>9.2.2.v20140723</version>            </plugin>        </plugins>    </build></project>

2,运行结果:
首先根据hibernate.properties创建数据库,不需要建表,启动Server的时候自动建表;

通过下面的链接进入操作页面:

http://localhost:8080/spring-mvc-crud/student.do

已实现查询/添加/删除功能:

3,git源代码地址:
https://git.oschina.net/coderdream/spring-mvc-crud

4,源代码下载:
  相关解决方案