https://my.oschina.net/u/3391025/blog/1842595 这里做得很不错
不静之心

分类:开源软件
nativefier-用一行代码将任意网页转化为桌面应用
官方文档: https://github.com/nativefier/nativefier/blob/mas…
使用Hessian获取客户端IP等信息
http://wesee.iteye.com/blog/663876 我们查看HessianSe…
自己整合SpringMVC+Hessian
Hessian知识学习总结 https://blog.csdn.net/wodediqizhang/artic…
Quartz存储与持久化-基于quartz.properties的配置
文章 https://blog.csdn.net/Evankaka/article/details/45540…
Fel是轻量级的高效的表达式计算引擎
http://itindex.net/detail/44416-fel-%E8%BD%BB%E9%87%8F%…
Jexl例子
Apache Commons JEXL 语法 https://ridikuius.github.io/Apac…
使用mybatis的ScriptRunner执行sql文件
http://blog.csdn.net/dream_broken/article/details/54340…
springmvc fastjson与Jackson的MessageConverter配置
Jackson spring的兼容性比较好,推荐使用,不要轻易使用fastjson来做controller转换…
birt 配置动态数据源
birt 配置动态数据源 http://blog.csdn.net/lianggeblog/article/d…
Birt使用Spring context
初始化:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
package com.pandy.birt; import com.pandy.birt.dto.AppException; import com.pandy.birt.dto.Report; import org.eclipse.birt.core.framework.IPlatformContext; import org.eclipse.birt.core.framework.Platform; import org.eclipse.birt.core.framework.PlatformServletContext; import org.eclipse.birt.report.engine.api.*; import org.springframework.beans.BeansException; import org.springframework.beans.factory.DisposableBean; import org.springframework.beans.factory.FactoryBean; import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContextAware; import org.springframework.web.context.ServletContextAware; import javax.servlet.ServletContext; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.File; import java.util.*; public class BirtEngineFactory implements FactoryBean<IReportEngine>, ApplicationContextAware, ServletContextAware, DisposableBean { private ApplicationContext applicationContext; private static ServletContext servletContext; private IReportEngine birtEngine; private Map<String, IReportRunnable> reports = new HashMap<>(); @Override protected void finalize() throws Throwable { super.finalize(); EngineConfig config = new EngineConfig(); //注入Spring和Servlet环境 config.getAppContext().put("applicationContext", this.applicationContext); config.getAppContext().put("servletContext", this.servletContext); startupOSGI(config); IReportEngineFactory factory = (IReportEngineFactory) Platform .createFactoryObject(IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY); this.birtEngine = factory.createReportEngine(config); loadReports();//载入报表 } } |
在rptdesign…
BI 开源工具介绍
国产: 开源BI软件 Poli https://github.com/shzlw/poli …
ht for web:基于HTML5的图形设计
官方 http://www.hightopo.com/ 官方中文: http://www.hightopo.c…
kanboard的安装和修改
项目源码: https://github.com/kanboard/kanboard.git 插件: htt…
关于Headless Chrome
初探 Headless Chrome https://zhuanlan.zhihu.com/p/2710018…
shiro整合ehcache AND SessionManager
shiro整合ehcache AND SessionManager https://my.oschina.ne…
Spring Mybatis 二级缓存整合
springMVC+mybatis+ehcache详细配置 https://my.oschina.net/u/…
定时任务Quartz的调用例子
TriggerListener和JobListener https://nkcoder.github.io/2…
Java将HTML转化为PDF+获得页数+合并PDF
Java将HTML转化为PDF+获得页数+合并PDF https://my.oschina.net/u/224…
nginx配置location总结及rewrite规则写法
nginx配置location总结及rewrite规则写法 https://my.oschina.net/u/…
SpringMVC整合fastdfs-client-java实现web文件上传下载
SpringMVC整合fastdfs-client-java实现web文件上传下载 https://my.os…
Apache POI .xlsx 下拉框实现
Apache POI .xlsx 下拉框实现 https://my.oschina.net/u/3035165…
Web Notifications API
Web Notifications API http://javascript.ruanyifeng.com/…
lombok的使用
lombok 的官方网址:http://projectlombok.org/ lombok在In…
使用POI 读取 Excel 文件,读取手机号码 变成 科学计数 的解决办法
使用POI 读取 Excel 文件,读取手机号码 变成 科学计数 的解决办法 https://my.oschi…
一步步完成FastDFS + Spring MVC上传下载整合示例
一步步完成FastDFS + Spring MVC上传下载整合示例 https://my.oschina.ne…
JAVA多媒体处理库-JAVE
JAVA多媒体处理库-JAVE http://baike.xsoftlab.net/view/746.html…
Aspose.Slides for Java 转成pdf和图片等
1 2 3 4 5 6 |
<dependency> <groupId>com.aspose</groupId> <artifactId>aspose-slides</artifactId> <version>16.7.0</version> <!--<version>17.5-jdk16</version>--> </dependency> |
[crayon-6814c08…
用poi把ppt或pptx转为图片
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 |
public static java.util.List<String> convertPng(File file, File outputFolder, String newFileName) throws Exception { // TODO 校验输入文件是否存在 以及是否为PPT java.util.List<String> newFileList = Lists.newArrayList(); try { if (!outputFolder.exists()) { outputFolder.mkdirs(); } if (StringUtils.isBlank(newFileName)) { newFileName = UUID.randomUUID().toString().replace("-", "")+"_"; } String newFilePath = null; FileInputStream is = new FileInputStream(file); HSLFSlideShow ppt = new HSLFSlideShow(is); is.close(); Dimension pgsize = ppt.getPageSize(); int idx = 1; for (HSLFSlide slide : ppt.getSlides()) { //防止中文乱码 for(HSLFShape shape : slide.getShapes()){ if(shape instanceof HSLFTextShape) { HSLFTextShape tsh = (HSLFTextShape)shape; for(HSLFTextParagraph p : tsh){ for(HSLFTextRun r : p){ r.setFontFamily("宋体"); } } } } newFilePath = outputFolder.getAbsolutePath() + "/" + newFileName + idx + ".png"; File newFile = new File(newFilePath); if (newFile.exists()) { newFile.delete(); } System.out.println("正在处理PPT TO PNG, page=" + idx); BufferedImage img = new BufferedImage(pgsize.width, pgsize.height, BufferedImage.TYPE_INT_RGB); Graphics2D graphics = img.createGraphics(); // clear the drawing area graphics.setPaint(Color.white); graphics.fill(new Rectangle2D.Float(0, 0, pgsize.width, pgsize.height)); // render slide.draw(graphics); // save the output FileOutputStream out = new FileOutputStream(newFilePath); javax.imageio.ImageIO.write(img, "png", out); out.close(); System.out.println("处理完成PPT TO PNG, page=" + idx); newFileList.add(newFilePath); idx++; } } catch (FileNotFoundException e) { throw new RuntimeException("没有找到相应的文件"); } catch (IOException e) { throw new RuntimeException("系统出现IO异常,无法继续处理"); }catch (OfficeXmlFileException e){ throw new RuntimeException("请使用2003, 2007的格式PPT"); }catch (Exception e){ e.printStackTrace(); throw new RuntimeException("请使用2003, 2007的格式PPT"); } return newFileList; } |
HttpClient4.x 使用cookie保持会话
HttpClient4.x 使用cookie保持会话 https://my.oschina.net/yiqif…
UEditor应用 —— 图片上传
UEditor应用 —— 图片上传 https://my.oschina.net/u/3452433/blog…
使用POI、Spring MVC导出EXCEL
https://my.oschina.net/u/2930573/blog/796620 另外一个工具类也相当…
maven setting.xml配置详解
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 |
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd"> <!--指定本地仓库存储路径。默认值为~/.m2/repository 即 ${user.home}/.m2/repository。 --> <localRepository>d:/.m2/repository</localRepository> <!--指定Maven是否需要和用户输入进行交互。true:需要与用户交互;false:使用一个合理的默认值。默认值为true。 --> <interactiveMode>true</interactiveMode> <!--指定是否使用plugin-registry.xml文件来管理插件版本。设为true表示使用。默认值为false。--> <usePluginRegistry>false</usePluginRegistry> <!--指定是否在离线模式下运行。设为true表示项目构建要在离线模式下运行,默认值为false。 --> <offline>false</offline> <!-- 指定插件groupId列表,用于搜索时插件的groupId没有明确规定。 --> <pluginGroups> <!-- 指定使用插件查找进一步的组标识符 --> <pluginGroup>com.micmiu.plugins</pluginGroup> </pluginGroups> <!-- 指定这台机器连接到网络的代理服务器的列表。除非另有规定(系统属性或命令行开关), 列表中配置的第一代理将被激活使用。--> <proxies> <!-- 配置代理服务器的相关参数 --> <proxy> <!-- 代理标识ID,默认值:default --> <id>micmiuProxy</id> <!-- 指定是否激活,默认值:true --> <active>true</active> <!-- 指定代理协议,默认值:http --> <protocol>http</protocol> <!-- 指定代理认证的用户名 --> <username>micmiu</username> <!-- 指定代理认证用户的密码 --> <password>mypwd</password> <!-- 指定代理服务器的主机名 --> <host>micmiu.com</host> <!-- 指定代理服务的端口 默认值:8080 --> <port>80</port> <!-- 指定不被代理的主机名列表。多个用|分隔。--> <nonProxyHosts>ctosun.com|ctosun.micmiu.com</nonProxyHosts> </proxy> </proxies> <!-- 这是一个认证配置的列表,系统内部根据配置的serverID使用。认证配置用于maven链接到远程服务--> <servers> <!-- 指定的身份认证信息用于连接到一个特定的服务器时,确定系统内的唯一的名称(简称下面的'id'属性)。--> <server> <!-- 这是server的id(注意不是用户登陆的id)。该id与distributionManagement中repository元素的id必须要匹配。--> <id>micmiu-releases</id> <!-- 服务器认证的用户名 --> <username>michael</username> <!-- 服务器认证的用户对应的密码 --> <password>mypwd</password> </server> <!-- 另一个示例 私钥/密码 --> <server> <id>micmiu-snapshots</id> <!-- 认证时使用的私钥文件。 --> <privateKey>/home/micmiu/.ssh/id_dsa</privateKey> <!-- 认证时使用的私钥密码,没有密码就设为空 --> <passphrase>mypwd</passphrase> <!-- 目录被创建时的权限设置。其值对应了unix文件系统的权限,如664,或者775 --> <directoryPermissions>775</directoryPermissions> <!-- 仓库文件创建时的权限设置。其值对应了unix文件系统的权限,如664,或者775。 --> <filePermissions>664</filePermissions> </server> </servers> <!-- 指定镜像列表,用于从远程仓库下载资源 --> <mirrors> <!-- 指定仓库的镜像站点,代替一个给定的库。该镜像藏库有一个ID相匹配的mirrorOf元素。 ID是用于继承和直接查找目的,必须是唯一的。--> <mirror> <!--该镜像的唯一标识符。id用来区分不同的mirror元素。 --> <id>mirrorId</id> <!--被镜像的服务器的id,比如:central,不能和id匹配。--> <mirrorOf>central</mirrorOf> <name>micmiu for dev.</name> <url>http://dev.micmiu.com/repo/maven2</url> </mirror> </mirrors> <!-- 这是一个可以在各种不同的方式激活的配置文件列表,并可以修改构建过程。在settings.xml中提供的信息, 旨在提供本地机器允许建立在本地环境中工作的具体路径和库位置。有多种方式可以激活配置属性:一种在settings.xml中<activeProfiles>指定; 另一种实质上依赖于系统属性,无论是匹配特定的属性值或只是测试到它的存在.配置文件也可以根据JDK版本的前缀进行激活,1.4 可以激活1.4.2_07 注:对于在settings.xml中定义的配置,你仅限于指定资源仓库、插件仓库和用于插件在POM中变量的自由形式属性的定义 --> <profiles> <!-- 指定生成过程的介绍,使用一个或多个上述机制被激活。对于继承而言,激活通过<activatedProfiles/>或命令行配置文件, 配置文件必须有一个唯一的ID。此配置文件的例子使用的JDK版本触发激活。--> <profile> <!--该配置的唯一标识符。 --> <id>jdk-1.4</id> <!--自动触发配置文件的逻辑定义。Activation的逻辑配置决定了是否开启该profile。activation元素并不是激活profile的唯一方式。 settings.xml文件中的activeProfile元素可指定需要激活的profile的id。 profile也可以通过在命令行,使用-P标记和逗号分隔的列表来显式的激活 --> <activation> <!--指定是否激活的标识 默认值为false--> <activeByDefault>false</activeByDefault> <!--当匹配的jdk被检测到,profile被激活。例如,1.4激活JDK1.4,1.4.0_2,而!1.4激活所有不是以1.4开头的JDK版本。--> <jdk>1.4</jdk> <!-- 当检测到匹配的操作系统属性时,指定该配置文件将被激活, --> <os> <!--激活profile的操作系统的名字 --> <name>windows 7</name> <!--激活profile的操作系统所属家族(如 'windows') --> <family>windows</family> <!--激活profile的操作系统体系结构 --> <arch>x86</arch> <!--激活profile的操作系统版本--> <version>6.1</version> </os> <!-- 检测系统对应的属性和值(该值可在POM中通过${属性名称}引用),配置就会被激活。 如果值字段是空的,那么存在属性名称字段就会激活 --> <property> <!-- 属性的名称 --> <name>mavenVersion</name> <!-- 属性的值 --> <value>3.0.4</value> </property> <!-- 通过检测该文件的是否存在来激活配置。missing检查文件是否存在,如果不存在则激活profile;exists则会检查文件是否存在,如果存在则激活。--> <file> <!--如果指定的文件存在,则激活profile。 --> <exists>/usr/local/micmiu/workspace/myfile</exists> <!--如果指定的文件不存在,则激活profile。--> <missing>/usr/local/micmiu/workspace/myfile</missing> </file> </activation> <!-- 对应profile的扩展属性列表。Maven属性和Ant中的属性一样,可以用来存放一些值。这些值可以在POM中的任何地方使用标记${X}来使用, 这里X是指属性的名称。属性有五种不同的形式,并且都能在settings.xml文件中访问。 1. env.X: 表示系统环境变量。例如,"env.PATH" 等同于 $path环境变量(在Windows上是%PATH%)。 2. project.x:表示 POM中对应的属性值。 3. settings.x: 表示 settings.xml中对应属性值。 4. Java系统属性: 所有可通过java.lang.System.getProperties()访问的属性都能在POM中使用该形式访问。 5. x: 在<properties/>元素中,或者外部文件中设置,以${someVar}的形式使用。 --> <properties> <user.blog>www.micmiu.com</user.blog> </properties> </profile> <!-- 这是另一个配置文件,根据系统属性来激活 --> <profile> <!--该配置的唯一标识符。 --> <id>env-dev</id> <activation> <property> <!-- 被用来激活配置文件的属性的名称 --> <name>target-env</name> <!-- 被用来激活配置文件的属性的值 --> <value>dev</value> </property> </activation> <!-- 指定配置文件的扩展配置 内容采取property.value的形式 --> <properties> <tomcatPath>/path/to/tomcat/instance</tomcatPath> </properties> </profile> <profile> <id>repo-dev</id> <!-- 配置远程仓库列表 --> <repositories> <!-- 远程仓库的配置信息 --> <repository> <!-- 远程仓库唯一标识--> <id>nexus</id> <!-- 远程仓库名称 --> <name>nexus for develop</name> <!-- 远程仓库URL --> <url>http://192.168.1.8:8080/nexus/content/groups/public/</url> <layout>default</layout> <releases> <!--是否使用这个资源库下载这种类型的构件 默认值:true--> <enabled>true</enabled> <!--指定下载更新的频率。这里的选项是:always(一直),daily(每日,默认值),interval:X(这里X是指分钟),或者never(从不)。 --> <updatePolicy>daily</updatePolicy> <!--当Maven验证构件校验文件失败时该怎么做fail(失败)或者warn(告警)。--> <checksumPolicy>warn</checksumPolicy> </releases> <snapshots> <!--是否使用这个资源库下载这种类型的构件 默认值:true--> <enabled>true</enabled> <!--指定下载更新的频率。这里的选项是:always(一直),daily(每日,默认值),interval:X(这里X是指分钟),或者never(从不)。 --> <updatePolicy>daily</updatePolicy> <!--当Maven验证构件校验文件失败时该怎么做fail(失败)或者warn(告警)。--> <checksumPolicy>warn</checksumPolicy> </snapshots> </repository> </repositories> <pluginRepositories> <pluginRepository> <id>nexus</id> <name>local nexus</name> <url>http://192.168.1.8:8080/nexus/content/groups/public</url> <layout>default</layout> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>true</enabled> </snapshots> </pluginRepository> </pluginRepositories> </profile> </profiles> <!-- 指定被激活的配置文件--> <activeProfiles> <activeProfile>repo-dev</activeProfile> </activeProfiles> </settings> |
如何禁止anonymous用户访问nexus
nexus在默认情况下是允许anonymous用户浏览仓库,并下载仓库中的jar包的,如果我们搭建的私服是有公…
shiro实现用户踢出功能
shiro实现用户踢出功能 https://my.oschina.net/qixiaobo025/blog/9…