SSH学习之环境搭建

来源:互联网 发布:软件企业的商业模式 编辑:程序博客网 时间:2024/06/05 16:13

此次SSH学习步骤:1.练习的项目是基于maven的项目。

                                 2.先部署,学习Struts1。

                                 3.然后学习hibernate。

                                 4.最后学习spring。

                                 5.做一个SSH的综合项目。

                                 6.然后开始学习Struts2等等。

1.在eclipse中集成maven,新建maven project,archetype选择maven-archetype-webapp,点击next输入group Id,Artifact Id,然后finish。

2.在项目pom文件添加需要从中央仓库下的包,添加相应的dependency,然后可以在eclipse中会自动下载jar包,如果没下载完全,或者后面想添加包,1.可以到包含pom文件的文件目录执行cmd,然后输入mvn clean,mvn install重新下包;2.也可先确定本地仓库有没有xxxlastUpdated文件,先删除,然后在eclipse中 update project:

<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.bleum</groupId><artifactId>helloSSH</artifactId><packaging>war</packaging><version>0.0.1-SNAPSHOT</version><name>helloSSH Maven Webapp</name><url>http://maven.apache.org</url><dependencies><dependency><groupId>junit</groupId><artifactId>junit</artifactId><version>3.8.1</version><scope>test</scope></dependency><!-- struts2核心包 --><dependency><groupId>org.apache.struts</groupId><artifactId>struts2-core</artifactId><version>2.3.1.2</version></dependency><!-- struts核心包 --><dependency><groupId>org.apache.struts</groupId><artifactId>struts-core</artifactId><version>1.3.10</version></dependency><!-- struts2与spring整合的包 --><dependency><groupId>org.apache.struts</groupId><artifactId>struts2-spring-plugin</artifactId><version>2.3.1.2</version></dependency><!-- 在 Struts2中要使用 Ajax获得Json数据。要使用Ajax必须引用此Jar --><dependency><groupId>org.apache.struts</groupId><artifactId>struts2-json-plugin</artifactId><version>2.3.1.2</version></dependency><!-- Hibernate核心包 --><dependency><groupId>org.hibernate</groupId><artifactId>hibernate-core</artifactId><version>3.6.10.Final</version></dependency><!-- spring3可选的依赖注入,不可缺少 --><dependency><groupId>org.aspectj</groupId><artifactId>aspectjweaver</artifactId><version>1.7.3</version></dependency><!-- 扩展Java类与实现Java接口 --><dependency><groupId>cglib</groupId><artifactId>cglib</artifactId><version>2.2</version></dependency><!-- 运用Log4j必须用到这个包 --><dependency><groupId>org.slf4j</groupId><artifactId>slf4j-api</artifactId><version>1.7.5</version><scope>compile</scope></dependency><!-- Spring包 --><!-- Spring核心包 --><dependency><groupId>org.springframework</groupId><artifactId>spring</artifactId><version>2.5.6</version><type>jar</type></dependency><!-- Spring在WEB上的MVC框架上加上这个包 --><dependency><groupId>org.springframework</groupId><artifactId>spring-webmvc</artifactId><version>3.2.3.RELEASE</version><type>jar</type><scope>compile</scope></dependency><!-- log4j日志包 --><dependency><groupId>log4j</groupId><artifactId>log4j</artifactId><version>1.2.16</version><scope>compile</scope></dependency><!-- jsp接口 --><dependency><groupId>javax.servlet.jsp</groupId><artifactId>jsp-api</artifactId><version>2.1</version><scope>provided</scope></dependency><!-- 连接池 --><dependency><groupId>c3p0</groupId><artifactId>c3p0</artifactId><version>0.9.1.2</version></dependency><!-- servlet接口 --><dependency><groupId>javax.servlet</groupId><artifactId>servlet-api</artifactId><version>2.5</version><scope>provided</scope></dependency><!-- Mysql数据库JDBC连接包 --><dependency><groupId>mysql</groupId><artifactId>mysql-connector-java</artifactId><version>5.1.26</version><scope>compile</scope></dependency></dependencies><build><finalName>helloSSH</finalName></build></project>
3.到此为止包下下来了,先不管全不全,先进行Struts1的学习,下一篇博客将以登陆为例进行Struts1的入门学习。

0 0