设为首页 加入收藏

TOP

demo_1(一)
2019-09-17 17:35:06 】 浏览:81
Tags:demo_1

我练习的demo是基于SSM+MySQL+Eclipse+Tomcat8+Maven3实现的;

创建项目

##  创建Maven Project:

  Artifact Id: cn.com.demo
       Group Id: demo

##  完成项目的基本配置

##  生成web.xml

##  添加Tomcat Runtime

##  添加pom.xml

 1 <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">  2 <modelVersion>4.0.0</modelVersion>  3 <groupId>cn.xx</groupId>  4 <artifactId>demo</artifactId>  5 <version>0.0.1-SNAPSHOT</version>  6 <packaging>war</packaging>  7 <dependencies>  8 <!-- spring 的依赖jar包 -->  9 <dependency> 10 <groupId>org.springframework</groupId> 11 <artifactId>spring-webmvc</artifactId> 12 <version>4.3.9.RELEASE</version> 13 </dependency> 14 15 <!-- spring-jdbc的依赖jar包 --> 16 <dependency> 17 <groupId>org.springframework</groupId> 18 <artifactId>spring-jdbc</artifactId> 19 <version>4.3.9.RELEASE</version> 20 </dependency> 21 22 <!-- junit测试jar包 --> 23 <dependency> 24 <groupId>junit</groupId> 25 <artifactId>junit</artifactId> 26 <version>4.12</version> 27 </dependency> 28 29 <!-- 数据库的连接池 --> 30 <dependency> 31 <groupId>commons-dbcp</groupId> 32 <artifactId>commons-dbcp</artifactId> 33 <version>1.4</version> 34 </dependency> 35 36 <!-- mysql数据库 --> 37 <dependency> 38 <groupId>MySQL</groupId> 39 <artifactId>mysql-connector-java</artifactId> 40 <version>5.1.6</version> 41 </dependency> 42 43 <!-- mybatis --> 44 <dependency> 45 <groupId>org.mybatis</groupId> 46 <artifactId>mybatis</artifactId> 47 <version>3.2.5</version> 48 </dependency> 49 50 <!-- mybatis-spring整合 --> 51 <dependency> 52 <groupId>org.mybatis</groupId> 53 <artifactId>mybatis-spring</artifactId> 54 <version>1.3.2</version> 55 </dependency> 56 57 <!-- jstl --> 58 <dependency> 59 <groupId>jstl</groupId> 60 <artifactId>jstl</artifactId> 61 <version>1.2</version> 62 </dependency> 63 64 </dependencies> 65 </project>

##  配置web.xml

 1 <?xml version="1.0" encoding="UTF-8"?>
 2 <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 3  xmlns="http://java.sun.com/xml/ns/javaee"
 4  xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
 5  version="2.5">
 6     <display-name>demo</display-name>
 7     
 8     <welcome-file-list>
 9         <welcome-file>index.html</welcome-file>
10         <welcome-file>index.jsp</welcome-file>
11     </welcome-file-list>
12     <!-- Servlet控制器 -->
13     <servlet>
14         <servlet-name>dispatcherServlet</servlet-name>
1
首页 上一页 1 2 3 4 5 6 下一页 尾页 1/6/6
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇项目10天投产,测试仅剩2天,如何.. 下一篇OpenID Connect Core 1.0(九)声..

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目