忙了一天,终于把框架搭建起来了,很高兴。公司要求使用 jersey 1.17+spring 3.1.0.RELEASE+hibernate 3.3.1.GA 来完成框架,以前都用springmvc的。今天新东西就当学些了。下面把配置文件及源代码部署出来,供参考。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>ysb.unicorm</groupId> <artifactId>jplatform</artifactId> <packaging>war</packaging> <version>0.0.1-SNAPSHOT</version> <name>jplatform Maven Webapp</name> <url>http://maven.apache.org</url> <properties> <org.springframework.version>3.1.0.RELEASE</org.springframework.version> <org.hibernate.version>3.3.1.GA</org.hibernate.version> <org.hibernate.entitymanager.version>3.4.0.GA</org.hibernate.entitymanager.version> <connect.mysql.java.version>5.1.26</connect.mysql.java.version> <com.sun.jersey.version>1.17</com.sun.jersey.version> </properties> <dependencies> <dependency> <groupId>javax.servlet</groupId> <artifactId>javax.servlet-api</artifactId> <version>3.1-b02</version> <type>jar</type> </dependency> <dependency> <groupId>commons-lang</groupId> <artifactId>commons-lang</artifactId> <version>2.6</version> </dependency> <dependency> <groupId>com.sun.jersey</groupId> <artifactId>jersey-servlet</artifactId> <version>${com.sun.jersey.version}</version> <!--<scope>provided</scope>--> </dependency> <dependency> <groupId>com.sun.jersey</groupId> <artifactId>jersey-json</artifactId> <version>${com.sun.jersey.version}</version> <!--<scope>provided</scope>--> </dependency> <dependency> <groupId>com.sun.jersey.contribs</groupId> <artifactId>jersey-multipart</artifactId> <version>${com.sun.jersey.version}</version> <!--<scope>provided</scope>--> </dependency> <dependency> <groupId>com.sun.jersey.contribs</groupId> <artifactId>jersey-spring</artifactId> <version>${com.sun.jersey.version}</version> </dependency> <!-- 添加spring 支持 --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-orm</artifactId> <version>${org.springframework.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-context-support</artifactId> <version>${org.springframework.version}</version> </dependency> <!-- 添加hhibernate支持 --> <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-annotations</artifactId> <version>${org.hibernate.version}</version> <exclusions> <exclusion> <artifactId>asm-attrs</artifactId> <groupId>asm</groupId> </exclusion> <exclusion> <artifactId>asm</artifactId> <groupId>asm</groupId> </exclusion> <exclusion> <artifactId>cglib</artifactId> <groupId>cglib</groupId> </exclusion> </exclusions> </dependency> <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-entitymanager</artifactId> <version>${org.hibernate.entitymanager.version}</version> </dependency> <!-- 添加mysql 支持 --> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <version>${connect.mysql.java.version}</version> </dependency> <!-- 添加dbcp支持 --> <dependency> <groupId>commons-dbcp</groupId> <artifactId>commons-dbcp</artifactId> <version>1.4</version> </dependency> <dependency> <groupId>org.aspectj</groupId> <artifactId>aspectjweaver</artifactId> <version>1.7.2</version> </dependency> <dependency> <groupId>cglib</groupId> <artifactId>cglib-nodep</artifactId> <version>2.1_3</version> </dependency> <!-- log4j --> <dependency> <groupId>log4j</groupId> <artifactId>log4j</artifactId> <version>1.2.16</version> <scope>runtime</scope> </dependency> </dependencies> <build> <finalName>jplatform</finalName> </build> </project>
web.xml内容如下
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd" > <web-app> <display-name>Archetype Created Web Application</display-name> <!-- 添加spring应用 --> <context-param> <param-name>contextConfigLocation</param-name> <param-value>classpath:applicationContext-*.xml</param-value> </context-param> <context-param> <param-name>SystemGlobalsPropertiesn</param-name> <param-value>SystemGlobals.properties</param-value> </context-param> <filter> <filter-name>Spring character encoding filter</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>Spring character encoding filter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> <!-- --> <listener> <listener-class>com.ysb.unicorm.listeners.ConfigInitializer</listener-class> </listener> <servlet> <servlet-name>com.sun.jersey.samples.helloworld.resources.MyApplication</servlet-name> <servlet-class>com.sun.jersey.spi.spring.container.servlet.SpringServlet</servlet-class> <init-param> <param-name>com.sun.jersey.config.property.packages</param-name> <param-value>com.ysb.unicorm.controllers</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>com.sun.jersey.samples.helloworld.resources.MyApplication</servlet-name> <url-pattern>/*</url-pattern> </servlet-mapping> </web-app>
相关推荐
标题 "jersey 2.2 +spring 3.1.0.RELEASE+hibernate 3.3.1.GA maven 配置文件" 暗示了一个集成开发环境,其中涉及到三个主要的技术组件:Jersey、Spring 和 Hibernate。这个配置文件是基于 Maven 构建系统的,用于...
org.springframework.web-3.1.0.RELEASE.jar
Struts2.2.1+Spring3.1.0.M2+Hibernate3.5.1是经典的Java企业级开发框架组合,通常被称为SSH框架。这个整合配置Demo旨在演示如何将这三个强大的框架集成在一起,实现MVC(模型-视图-控制器)架构,提供数据持久化和...
本文将深入探讨这三者在Struts2.2.3、Spring3.1.0.M2和Hibernate3.6.6版本下的整合细节。 ### Struts2.2.3 Struts2是基于Servlet的MVC框架,提供了丰富的插件和拦截器机制,使得开发者能够轻松构建Web应用程序。在...
《Spring Framework 3.1.0.RELEASE:深入解析与应用》 Spring Framework作为Java开发中的核心框架,自诞生以来就以其强大的IoC(Inversion of Control)和AOP(Aspect Oriented Programming)特性,极大地简化了...
《Spring Security 3.1.0.RELEASE:企业级安全框架深度解析》 Spring Security是Java平台上广泛使用的安全框架,其3.1.0.RELEASE版本是该框架的一个重要里程碑,为开发者提供了全面的安全控制,从Web应用到企业级...
此外,Spring 3.1.0.RELEASE还改进了数据访问层,特别是对JPA和Hibernate的支持。它引入了Repository抽象,为数据库操作提供了更统一的接口。开发者可以自定义Repository接口,Spring会自动实现这些接口,提供CRUD...
本教程将围绕"idea + spring4.3.7.RELEASE + cxf3.1.0"的整合进行详细讲解,旨在帮助开发者理解如何在IDEA(IntelliJ IDEA)环境中搭建一个基于Maven的Spring MVC项目,并结合Apache CXF实现Web服务的消费与提供。...
org.springframework.beans-3.1.0.RELEASE.jar
《Spring Web MVC框架详解——基于org.springframework.web.servlet-3.1.0.RELEASE.jar》 在Java Web开发领域,Spring框架无疑是最具影响力的框架之一,其中Spring Web MVC是其核心组件,专注于处理Web请求和响应。...
jeecg-framework-3.1.0.RELEASE 20130414.zipjeecg-framework-3.1.0.RELEASE 20130414.zipjeecg-framework-3.1.0.RELEASE 20130414.zipjeecg-framework-3.1.0.RELEASE 20130414.zipjeecg-framework-3.1.0.RELEASE ...
spring-context-3.1.0.RELEASE
org.springframework.context.support-3.1.0.M1.jar包,无毒下载
这是spring-asm-3.1.0.RELEASE.jar,为了使用方便传上来.
《Spring与Struts整合——基于org.springframework.web.struts-3.1.0.M2.jar的实践探索》 在Java Web开发领域,Spring框架以其强大的依赖注入和面向切面编程能力,以及丰富的模块支持,成为了广大开发者青睐的框架...
spring-core-3.1.0.RELEASE.jar
struts2.2.3 + spring3.1.0 + mybatis3.1.0集成简单demo。具体请看:http://blog.csdn.net/afgasdg/article/details/7392367