如何创建集成SSH项目的maven项目——提供pom文件
个人琢磨了几天的原创,未经同意请勿转载。
不同网上搜索的方式,本方法导入eclipse、myeclipse、等IDE工具可以直接使用。
一、创建如下目录结构
\src\main\java
\src\main\resources
\src\main\webapp\WEB-INF
\src\test\java
\src\test\resources
二、在\src\main\webapp\WEB-INF中创建如下文件
web.xml
struts.xml
applicationContext.xml
hibernate.cfg.xml
三、创建pom文件(重点)
内容如下:
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<context-param>
<param-name>contextConfigLocation</param-name>
<!-- <param-value>classpath:applicationContext.xml</param-value> -->
<param-value>/WEB-INF/applicationContext.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
<init-param>
<param-name>config</param-name>
<param-value>struts-default.xml,struts-plugin.xml,../../WEB-INF/struts.xml</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter>
<filter-name>encoding</filter-name>
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>UTF-8</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>encoding</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter>
<filter-name>OpenSessionInViewFilter</filter-name>
<filter-class>org.springframework.orm.hibernate3.support.OpenSessionInViewFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>OpenSessionInViewFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
</web-app>
四、在eclipse或myeclipse等IDE工具导入maven项目
相关推荐
SSH框架Maven项目pom.xml
这是构建基于Maven的SSH原型项目视频文件,初学者可以进行参考
Maven的pom.xml配置文件详细配置说明 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=...
一、Idea关联的maven本地仓库配置...三、3个可单独使用的,maven项目文件pom.xml自定义配置 pom-maven-springboot-CusConfigV1.xml pom-maven-springboot-CusConfigV2.xml pom-maven-spring-CusConfigV1不推荐使用.xml
利用maven技术整合ssh框架的pom.xml! 利用maven技术整合ssh框架的pom.xml 利用maven技术整合ssh框架的pom.xml
Maven整合SSH案例 ************************************************************************************* 注意:运行前请配置Maven环境,和修改config.properties中数据库名称用户和密码,并且修改Tuser中的...
pom.xml文件里面主要配置项目开发所需要的依赖包,maven可以管理开发所需的jar包,在线下载jar包,可节省本地的资源空间
摘要:本文主要讲解是Maven使用过程中一些常用的命令,并配上图片说明,最后还讲了pom.xml文件的一些构造。-D传入属性参数-P使用pom中指定的配置-e显示maven运行出错的信息-o离线执行命令,即不去远程仓库更新包-X...
创建springMVC步骤:1、新建 maven 项目;2、添加pom依赖;3、添加web框架;4、创建项目结构;5、创建并配置springmvc.xml文件;6、配置web.xml文件;7、实现控制器功能;8、设置web依赖;9、项目发布并运行。
该pom文件整合了spring,struts2,hibernate5框架和shiro权限框架所需的jar包,完美无冲突
将pom的依赖直接粘贴进pom.xml,运行bat文件就可以将jar包一次性下载。需要maven环境
记录一下自己常用的maven工程的pom.xml配置详解,各个标签详解
maven项目的配置POM配置文件,主要是maven项目的配置,直接从中央仓库下载内容。
ssh项目模板、ssm项目模板、spring+springmvc+hibernate+maven项目模板,纯净模板
这是maven管理的动态web项目的pom.xml配置文件,里面有ssm框架需要用到的jar包依赖
项目管理利器——maven,技术开发学习类稳定档案顶顶顶顶
<listener-class>org.springframework.web.context.ContextLoaderListener </listener> <param-name>contextConfigLocation <param-value>classpath:applicationContext.xml </context-param>
pom.xml配置文件,包含数据库,仓库地址配置等等
SSH+maven搭建的项目