整合spring roo,maven,mybatis,spring-flex,blazeds,mysql
1. 下载spring roo,设置环境变量ROO_HOME,和path,classpath.
使用CMD命令行找到工作区间,新建工程目录转到工程目录;mkdir ten-minutes
$ cdten-minutes
2. project--topLevelPackage com.tenminutes
3. roo>jpa setup --provider HIBERNATE--database HYPERSONIC_IN_MEMORY
4. roo>hint
5. roo>entity jpa --class ~.Timer--testAutomatically
6. roo>hint
7. roo>field string --fieldName message--notNull
8. roo>hint web mvc
9. roo>web mvc setup
10. roo>web mvc all --package ~.web
11. roo>selenium test --controller~.web.TimerController
12. roo>perform tests
13. roo>perform package
14. roo>perform eclipse
15. roo>quit
16. $mvn tomcat:run
添加<blazeds.version>4.0.0.14931</blazeds.version>为项目添加blazeds开发版本号
2.添加mybatis开发生成器:<!--mybatisgenerator -->
<repository>
<id>mybatis-snapshot</id>
<name>MyBatisSnapshot Repository</name>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</repository>
3.添加类库依赖<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
<version>3.0.1</version>
</dependency>
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis-spring</artifactId>
<version>1.1.0</version>
</dependency>
<!-- springflex-->
<dependency>
<groupId>org.springframework.flex</groupId>
<artifactId>spring-flex-core</artifactId>
<version>1.5.2.RELEASE</version>
</dependency>
<!-- Blazeds-->
<dependency>
<groupId>com.adobe.blazeds</groupId>
<artifactId>blazeds-core</artifactId>
<version>${blazeds.version}</version>
</dependency>
<dependency>
<groupId>com.adobe.blazeds</groupId>
<artifactId>blazeds-common</artifactId>
<version>${blazeds.version}</version>
</dependency>
<dependency>
<groupId>com.adobe.blazeds</groupId>
<artifactId>blazeds-proxy</artifactId>
<version>${blazeds.version}</version>
</dependency>
<dependency>
<groupId>com.adobe.blazeds</groupId>
<artifactId>blazeds-remoting</artifactId>
<version>${blazeds.version}</version>
</dependency>
4.mybatis插件<plugin>
<groupId>org.mybatis.generator</groupId>
<artifactId>mybatis-generator-maven-plugin</artifactId>
<version>1.3.1</version>
<configuration>
<verbose>true</verbose>
<overwrite>true</overwrite>
</configuration>
</plugin>
5.可能需要转到Blazeds目录将一些类库打进去maven类库,命令行如下:mvn install:install-file -Dpackaging=jar -DgroupId=com.adobe.blazeds -Dversion=4.0.0.14931 -DartifactId=blazeds-common -Dfile=flex-messaging-common.jar
mvn install:install-file -Dpackaging=jar -DgroupId=com.adobe.blazeds-Dversion=4.0.0.14931 -DartifactId=blazeds-core -Dfile=flex-messaging-core.jar
mvn install:install-file -Dpackaging=jar -DgroupId=com.adobe.blazeds-Dversion=4.0.0.14931 -DartifactId=blazeds-opt -Dfile=flex-messaging-opt.jar
mvn install:install-file -Dpackaging=jar -DgroupId=com.adobe.blazeds-Dversion=4.0.0.14931 -DartifactId=blazeds-proxy -Dfile=flex-messaging-proxy.jar
mvn install:install-file -Dpackaging=jar -DgroupId=com.adobe.blazeds-Dversion=4.0.0.14931 -DartifactId=blazeds-remoting -Dfile=flex-messaging-remoting.jar
mvn install:install-file -Dpackaging=jar -DgroupId=com.adobe.blazeds-Dversion=4.0.0.14931 -DartifactId=blazeds-rds-server -Dfile=flex-rds-server.jar
修改一下propertis,数据库配置文件,格式如下:#Updated at Mon Apr 09 09:15:39 CST 2012
#Mon Apr09 09:15:39 CST 2012
database.driverClassName=com.mysql.jdbc.Driver
database.url=jdbc\:mysql\://localhost\:3306/managerplatform
database.username=root
database.password=qwer123456
使用 database introspect --schemafeedback_schema 来内部检查数据库模式。
完成数据库模式内部检查以后,您可以用 database reverse engineer --schemafeedback_schema --package ~.domain 对模式进行反向工程。
准备好mybatis的生成器配置文件,利用命令行运行mvn mybatis-generator:generate。
6.上下文配置:<?xmlversion="1.0"encoding="UTF-8"standalone="no"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:jee="http://www.springframework.org/schema/jee"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/aophttp://www.springframework.org/schema/aop/spring-aop-3.1.xsd http://www.springframework.org/schema/beanshttp://www.springframework.org/schema/beans/spring-beans-3.1.xsd http://www.springframework.org/schema/contexthttp://www.springframework.org/schema/context/spring-context-3.1.xsd http://www.springframework.org/schema/jeehttp://www.springframework.org/schema/jee/spring-jee-3.1.xsd http://www.springframework.org/schema/txhttp://www.springframework.org/schema/tx/spring-tx-3.1.xsd">
<context:property-placeholderlocation="classpath*:META-INF/spring/*.properties"/>
<!-- enable autowire-->
<context:annotation-config/>
<context:component-scanbase-package="com.bingya">
</context:component-scan>
<tx:annotation-driven/>
<beanclass="org.springframework.jdbc.datasource.DriverManagerDataSource"
id="dataSource">
<propertyname="driverClassName"value="${database.driverClassName}"/>
<propertyname="url"value="${database.url}"/>
<propertyname="username"value="${database.username}"/>
<propertyname="password"value="${database.password}"/>
</bean>
<beanid="transactionManager"
class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<propertyname="dataSource"ref="dataSource"/>
</bean>
<!-- define the SqlSessionFactory-->
<beanid="sqlSessionFactory"class="org.mybatis.spring.SqlSessionFactoryBean">
<propertyname="dataSource"ref="dataSource"/>
<propertyname="typeAliasesPackage"value="com.bingya"/>
</bean>
<!-- scan formappers andlet them beautowired -->
<beanclass="org.mybatis.spring.mapper.MapperScannerConfigurer">
<propertyname="basePackage"value="com.bingya"/>
</bean>
</beans>
web.xml
- <?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
- <web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- version="2.5"
- xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
- <display-name>SpringRoo</display-name>
- <description>Roo generated SpringRoo application</description>
- <context-param>
- <param-name>contextConfigLocation</param-name>
- <param-value>classpath*:META-INF/spring/applicationContext*.xml</param-value>
- </context-param>
- <!-- Creates the Spring Container shared by all Servlets and Filters -->
- <listener>
- <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
- </listener>
- <!-- Handles Spring requests -->
- <servlet>
- <servlet-name>SpringRoo</servlet-name>
- <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
- <init-param>
- <param-name>contextConfigLocation</param-name>
- <param-value>WEB-INF/spring/webmvc-config.xml</param-value>
- </init-param>
- <load-on-startup>1</load-on-startup>
- </servlet>
- <servlet-mapping>
- <servlet-name>SpringRoo</servlet-name>
- <url-pattern>/messagebroker/*</url-pattern>
- </servlet-mapping>
- </web-app>
整合spring roo,maven,mybatis,spring-flex,blazeds,mysql的更多相关文章
- spring-第N篇整合SSM,即Mybatis+Spring+Spring MVC
1.Mybatis的配置使用 1>Jar包:mybatis-3.4.5.jar.mysql-connector-6.0.2或者ojdbc6-11.2.0.4.jar. 2>编写conf.x ...
- Eclipse+Spring+SpringMVC+Maven+Mybatis+MySQL+Tomcat项目搭建
---恢复内容开始--- 1. 建表语句及插入数据 CREATE TABLE `book_user` ( user_id INT(11) NOT NULL AUTO_INCREMENT, user_n ...
- Maven+Mybatis+Spring+SpringMVC实现分页查询
转载:http://www.cnblogs.com/zhangtan/p/5846955.html 一.项目搭建 关于项目搭建,小宝鸽以前写过一篇Spirng+SpringMVC+Maven+Myba ...
- Maven+Mybatis+Spring+SpringMVC实现分页查询(附源代码)
以下小宝鸽将分享一篇Mybatis分页功能的博文,以下将给出具体的步骤.跟着博主的节奏肯定能实现.另外最后还会附上整个project的源代码.假设是没有使用过maven的猿友可自行下载相关的jar包就 ...
- spring+springmvc+maven+mybatis整合
jar包依赖:网址search.maven.org 1.spring :spring-core 2. myhabits:myhabits 3.整合spring和myhabits: ...
- spring boot:使用mybatis访问多个mysql数据源/查看Hikari连接池的统计信息(spring boot 2.3.1)
一,为什么要访问多个mysql数据源? 实际的生产环境中,我们的数据并不会总放在一个数据库, 例如:业务数据库:存放了用户/商品/订单 统计数据库:按年.月.日的针对用户.商品.订单的统计表 因为统计 ...
- Spring Roo
Spring Roo 是SpringSource新的开放源码技术,该技术主要面向企业中的Java开发者,使之更富有成效和愉快的进行开发工作,而不会牺牲工程完整或灵活性.无论你是一个新的Java开发人员 ...
- spring boot 打包方式 spring boot 整合mybaits REST services
<build> <sourceDirectory>src/main/java</sourceDirectory> <plugins> <plugi ...
- Spring顶级项目以及Spring cloud组件
作为java的屌丝,基本上跟上spring屌丝的步伐,也就跟上了主流技术. spring 顶级项目: Spring IO platform:用于系统部署,是可集成的,构建现代化应用的版本平台,具体来说 ...
- Spring Boot入门(2)使用MySQL数据库
介绍 本文将介绍如何在Spring项目中连接.处理MySQL数据库. 该项目使用Spring Data JPA和Hibernate来连接.处理MySQL数据库,当然,这仅仅是其中一种方式,你也 ...
随机推荐
- 对于REST中无状态(stateless)的一点认识
今天早上在Yahoo的邮件列表里看到一篇颇有意思的讨论,标题为RESTful vs. unRESTful: Session IDs and Authentication(51CTO编者注:意为REST ...
- 线上redis服务内存异常分析。
项目中,新增了一个统计功能,用来统计不同手机型号的每天访问pv,看了下redis2.6有个setbit的功能,于是打算尝尝鲜把 redis从2.4更新到了2.6 因为是租了vps.服务器的内存只有4g ...
- pcap文件的文件头的link type
http://www.tcpdump.org/linktypes.html Link-layer header type values LINKTYPE_ name LINKTYPE_ value C ...
- 浅谈“be practical and realistic”
一 “实事求是”这个词,一般认为是古人的一种治学观念,后来经咏芝的发明.阐释.以及“应用”,成为“基本思想路线”(具体可参看大学思想政治教科书),被称为“活的灵魂”.这里不想过多地牵扯政治话题,仅就我 ...
- 数往知来C#之接口 值类型与引用类型 静态非静态 异常处理 GC垃圾回收 值类型引用类型内存分配<四>
C# 基础接口篇 一.多态复习 使用个new来实现,使用virtual与override -->new隐藏父类方法 根据当前类型,电泳对应的方法(成员) -->override ...
- PHP时间格式控制符对照表
format 字符 说明 返回值例子 日 --- --- d 月份中的第几天,有前导零的 2 位数字 01 到 31 j 月份中的第几天,没有前导零 1 到 31 S 每月天数后面的英文后缀,2 个字 ...
- Axure rp 基础知识 转
首先做个声明:此次教程里为了快速完成,借用了一些网上已有教程的图文,不是剽窃,只图方便.另外,因为汉化版本可能功能名称等略有差别,请自行理解. 名词解释: 线框图:一般就是指产品原型,比如:把线框图尽 ...
- 把数组A的奇数放在左边,偶数放在右边
这也是一道面试题,是不是easy到爆,但是渣渣我面试时一点算法状态都没有 这道题和上一篇博客里那道题的解法一模一样 # include <iostream> using namespace ...
- 【转】Java中只有按值传递,没有按引用传递!
原文链接:http://guhanjie.iteye.com/blog/1683637 今天,我在一本面试书上看到了关于java的一个参数传递的问题: 写道 java中对象作为参数传递给一个方法,到底 ...
- git 和 svn的区别(转)
英文原文:5 Fundamental differences between GIT & SVN,编译:外刊IT评论 如果你在读这篇文章,说明你跟大多数开发者一样对GIT感兴趣,如果你还没有机 ...