Activity 与 springMvc相整合
准备环境:
springMvc框架及Activity所需要的jar:
创建spring-activity.xml文件,里面内容:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context" xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.0.xsd
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd"
default-lazy-init="true">
<!-- 创建一个流程引擎的配置对象 -->
<bean id="processEngineConfiguration" class="org.activiti.spring.SpringProcessEngineConfiguration">
<property name="dataSource" ref="dataSource" />
<property name="transactionManager" ref="transactionManager" />
<!-- 设置数据库schema的更新方式 -->
<property name="databaseSchemaUpdate" value="false" />
<!-- 是否启动jobExecutor -->
<property name="jobExecutorActivate" value="false" />
<!-- <property name="databaseSchema" value="ACT"/> -->
<!-- <property name="deploymentResources">
<list>
<value>classpath:diagrams/MyProcess.bpmn</value>
<value>classpath:diagrams/MyProcess.png</value>
</list>
</property> -->
</bean>
<!-- 创建一个流程引擎bean -->
<bean id="processEngine" class="org.activiti.spring.ProcessEngineFactoryBean">
<property name="processEngineConfiguration" ref="processEngineConfiguration" />
</bean>
<!-- 创建activiti提供的各种服务 -->
<bean id="repositoryService" factory-bean="processEngine" factory-method="getRepositoryService" />
<bean id="runtimeService" factory-bean="processEngine" factory-method="getRuntimeService" />
<bean id="taskService" factory-bean="processEngine" factory-method="getTaskService" />
<bean id="historyService" factory-bean="processEngine" factory-method="getHistoryService" />
<bean id="managementService" factory-bean="processEngine" factory-method="getManagementService" />
<bean id="identityService" factory-bean="processEngine" factory-method="getIdentityService" />
<bean id="formService" factory-bean="processEngine" factory-method="getFormService" />
</beans>
然后在web.xml加入:
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
classpath:spring/spring-activiti.xml
</param-value>
</context-param>
启动就可以了。
如果报默报错 spring-activity.xml 改成如下:
<bean id="processEngineConfiguration" class="org.activiti.spring.SpringProcessEngineConfiguration">
<property name="dataSource" ref="dataSource" />
<property name="transactionManager" ref="transactionManager" />
<!-- 设置数据库schema的更新方式 -->
<property name="databaseSchemaUpdate" value="true" />
<!-- 是否启动jobExecutor -->
<property name="jobExecutorActivate" value="false" />
<property name="databaseSchema" value="ACT"/>
</bean>
Activity 与 springMvc相整合的更多相关文章
- sonne_game网站开发03 spring-mvc+freemarker整合
今天的任务就是在spring+mybatis+springmvc的基础上,将freemarker整合进来. freemarker是什么? freemarker是一种模板引擎.它的目的是基于模板和数据, ...
- spring-mvc+freemarker整合(sonne_game网站开发03)
今天的任务就是在spring+mybatis+springmvc的基础上,将freemarker整合进来. freemarker是什么? freemarker是一种模板引擎.它的目的是基于模板和数据, ...
- ssm之spring+springmvc+mybatis整合初探
1.基本目录如下 2.首先是向lib中加入相应的jar包 3.然后在web.xml中加入配置,使spring和springmvc配置文件起作用. <?xml version="1. ...
- Spring+springmvc+Mybatis整合案例 annotation版(myeclipse)详细版
Spring+springmvc+Mybatis整合案例 Version:annotation版 文档结构图: 从底层开始做起: 01.配置web.xml文件 <?xml version=&qu ...
- Spring+springmvc+Mybatis整合案例 xml配置版(myeclipse)详细版
Spring+springmvc+Mybatis整合案例 Version:xml版(myeclipse) 文档结构图: 从底层开始做起: 01.配置web.xml文件 <?xml version ...
- springMVC 相对于 Structs 的优势
智者说,没有经过自己的思考和估量,就不能接受别人的东西.资料只能是一个参考,至于是否正确,还得自己去分辨 SpringMVC相对于Structs的几个优势: 1.springMVC安全性更高,stru ...
- myBatis+SpringMVC+Maven整合
一.先创建表结构 二.使用generator通过表结构自动生成model和dao.mapper 使用步骤: 1.解压generator.rar文件 2.文件中的generator.xml文件需要进行修 ...
- SpringMVC+redis整合
在网络上有一个很多人转载的springmvc+redis整合的案例,不过一直不完整,也是被各种人装来转去,现在基本将该框架搭建起来. package com.pudp.bae.base; import ...
- SpringMVC 中整合之JSON、XML
每次看到好的博客我就想好好的整理起来,便于后面自己复习,同时也共享给网络上的伙伴们! 博客地址: springMVC整合Jaxb2.xStream: http://www.cnblogs.com/h ...
随机推荐
- Angular Universal(统一平台)笔记
angular官网高级文档AngularUniversal部分的翻译总结,这东西在angular4开始正式被官方支持了,目前其实支持的服务器端还没有很多,但好歹包括了node和DotNetCore,算 ...
- 合唱团 (线性dp)
题意:有 n 个学生站成一排,每个学生有一个能力值,牛牛想从这 n 个学生中按照顺序选取 k 名学生,要求相邻两个学生的位置编号的差不超过 d,使得这 k 个学生的能力值的乘积最大,你能返回最大的乘积 ...
- UVA-818 dfs + 位运算
暴力枚举一些圆环,将这些圆环解开,看能否成为单链.判断单链的三个条件: 除了这些删除的圆环之外,其他圆环还连接着的圆环不能超过两个. 剩下的环没有连成圈. 剩下的圆环共分成m堆,每堆之间无连接,m必须 ...
- zTree实现多选树
zTree实现多选树 1.实现源码 <!DOCTYPE html> <html> <head> <title>多选树</title> < ...
- Java代码输出是“father”还是“child”(一)
1.实例 /** * 以下代码输出的结果是 */ package com.you.model; /** * @author YouHaidong * 输出的结果 */ public class Fat ...
- Linux显示隐藏文件
Linux显示隐藏文件 youhaidong@youhaidong-ThinkPad-Edge-E545:~$ ls -a . .dbus .local .xsession-errors.old .. ...
- ubuntu16.04搭建ftp服务器
因为习惯了vs进行开发,所以对于Linux的代码编辑开发都在vs里面进行,通常我们都是ssh远程登录到Linux,使用ftp或者sftp共享Linux目录里面的文件方便对文件的共享,这里介绍一下在ub ...
- JNDI在本项目中的应用
一,在tomcat的context文件中做如下配置 <?xml version="1.0" encoding="UTF-8"?> <Conte ...
- PC软件与PLC串口通信 奇偶检验问题
PC软件与PLC进行串口通信 波特率:19200 校验位:偶检验 数据位:8 停止位:1 现象 一,PC软件向PLC可以发送1,2,4,5,7,8,但是3,6,9发送出去后,PLC无法收到 二,使 ...
- eclipse - The superclass "javax.servlet.http.HttpServlet" was not found on the Java