解决方式:

1.配置文件插入

<bean id="processEngineConfiguration" class="org.activiti.spring.SpringProcessEngineConfiguration">
<property name="dataSource" ref="dataSource" />
<property name="databaseSchemaUpdate" value="true" />
<property name="transactionManager" ref="transactionManager" />
<!-- 中文乱码问题 -->
<property name="activityFontName" value="宋体"></property>
<property name="labelFontName" value="宋体"/>
</bean>

 

2.生成图片代码中增加

public InputStream getDiagram(String processInstanceId) {
// 查询流程实例
ProcessInstance pi = this.runtimeService.createProcessInstanceQuery()
.processInstanceId(processInstanceId).singleResult();
// 强制类型转换为RepositoryServiceImpl
RepositoryServiceImpl rs = (RepositoryServiceImpl) this.processEngine
.getRepositoryService();
//1使用Spring注入
ProcessEngineConfigurationImpl processEngineConfigurationImpl = ((ProcessEngineImpl) this.processEngine)
.getProcessEngineConfiguration();
Context.setProcessEngineConfiguration(processEngineConfigurationImpl);
//2.不使用Spring注入
// ProcessEngineImpl defaultProcessEngine = (ProcessEngineImpl) ProcessEngines
// .getDefaultProcessEngine();
// Context.setProcessEngineConfiguration(defaultProcessEngine
// .getProcessEngineConfiguration());
BpmnModel bpmnModel = repositoryService.getBpmnModel(pi
.getProcessDefinitionId());
// 转换为输入流
InputStream is = ProcessDiagramGenerator.generateDiagram(bpmnModel,
"png", runtimeService.getActiveActivityIds(processInstanceId));
return is;
}

activiti5.15中文乱码问题的更多相关文章

  1. JS.中文乱码,Jsp\Servlet端的解决办法

    JS.中文乱码,Jsp\Servlet端的解决办法 2010-03-08 15:18:21|  分类: Extjs |  标签:encodeuricomponent  乱码  urldecoder   ...

  2. Java实现过滤中文乱码

    最近在日志数据清洗时遇到中文乱码,如果只要有非中文字符就将该字符串过滤掉,这种方法虽简单但并不可取,因为比如像Xperia™主題.天天四川麻将Ⅱ这样的字符串也会被过滤掉. 1. Unicode编码 U ...

  3. [转]Filter实现处理中文乱码,转义html标签,过滤敏感词

    原文地址:http://www.cnblogs.com/xdp-gacl/p/3952405.html 在filter中可以得到代表用户请求和响应的request.response对象,因此在编程中可 ...

  4. mysql保存中文乱码的原因和解决办法

    当你遇到这个mysql保存中文乱码问题的时候,期待找到mysql保存中文乱码的原因和解决办法这样一篇能解决问题的文章是多么激动人心.    也许30%的程序员会选择自己百度,结果发现网友已经贴了很多类 ...

  5. Web---演示servlet技术(servlet生命周期),解决中文乱码问题

    本节讲解决中文乱码问题的4种方法. 还有更好的方法,也就是用过滤器,这里就不演示了,博主目前也不会~呼♪(^∇^*)~过段时间才会学. servlet生命周期演示: index.jsp: <%@ ...

  6. springMvc解决json中文乱码

    springMvc解决json中文乱码 springMvc解决json中文乱码,springMvc中文乱码,spring中文乱码 >>>>>>>>> ...

  7. redhat6.3 jfreechar中文乱码解决途径

    最近使用到jfreechar的项目,在转移到linux上面时出现中文乱码(中文被显示为框框),网上查了一些资料,结合自身系统的特性,总结了一种安装字体的方式.在说字体安装之前首先上个测试的代码吧:we ...

  8. XFtp中文乱码解决

    异常处理汇总-开发工具  http://www.cnblogs.com/dunitian/p/4522988.html 一张图解决 异常处理汇总:http://www.cnblogs.com/duni ...

  9. 使用过滤器(Filter)解决请求参数中文乱码问题(复杂方式)

    前述:      在写这篇笔记之前,对笔记中的设计模式进行介绍:      本篇笔记中将要使用到的设计模式是:装饰(包装)设计模式           (1)装饰(包装)设计模式口诀:         ...

随机推荐

  1. 【jQuery UI 1.8 The User Interface Library for jQuery】.学习笔记.8.Datepicker控件

    默认datepicker的安装启用 探索它的配置选项 安装启用一个触发按钮 配置一个供选择的动画 dateFormat选项 简单的国际化 多月datepicker 日期范围选择 datepicker的 ...

  2. while DEMO

    while DEMO #!/bin/bash #author:xiluhua #since: let v_count= " ] do ] then sleep echo $v_count l ...

  3. Docker 端口映射问题解决

    在操作Docker容器时发现了其一个端口映射的BUG,具体表现为:开启容器时做了端口映射80:8080,即宿主机的80端口映射到容器内部的8080Jboss端口.一开始测试也没有什么问题,都可以联通, ...

  4. 《C++标准库》

    函数对象 使用bind时注意,占位符有自己的命名空间std::placeholders,如果不在程序开始处using std::placeholders,那么就要写成: std::bind(std:: ...

  5. asp.net dropdownlist和listbox

    if (!IsPostBack) { //页面初次加载时执行这里的内容 DataSet ds = new DataSet(); //数据集 ds.Tables.Add("stu") ...

  6. PHP下的购物车

    导航 <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta h ...

  7. c#播放器

    using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; usin ...

  8. JQuery知识快览之五—操作属性和结构

    前文提到JQuery提供了丰富的内置方法来操作对象集,本文主要介绍JQuery中的那些内置操作属性和DOM结构的方法. prop还是attr? 从JQuery1.6版开始,新增了prop方法来获取和设 ...

  9. Combox控件初始化项的技巧

    有时候combox下拉项就是几条固定的,不需要做数据绑定,但是如果直接采用字符串集合编辑器的时候,SelectedValue貌似会不起作用. 于是简单的封装一下 /// <summary> ...

  10. Codeforces Round #368 (Div. 2) B

    Description Masha wants to open her own bakery and bake muffins in one of the n cities numbered from ...