- 浏览: 36454 次
- 性别:
- 来自: 深圳
最新评论
文章列表
jSsignature 数字签名,保存图片
- 博客分类:
- javaWeb
获取页面传递字符
String data = req.getParameter("data");
String imageData=data.substring(data.indexOf(",")+2, data.length()-2);
//System.out.println(imageData.indexOf("\\"));
//String s="\\";
//imageData=imageData.replaceAll(s, " ");
image ...
poi docx 字符,图片替换
- 博客分类:
- JavaEE
项目中遇到 word动态替换参数,及图片的问题、总结一下
maven pom.xml jar包导入
<!-- poi -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>3.12</version>
</dependency>
<dependency>
<groupId>org. ...
转:
http://blog.csdn.net/zgmzyr/article/details/8267072
public static String decode(String str62) {
String[] ss = split(str62, 4);
StringBuilder sb = null;
for (String s : ss) {
s = toDecString(s);
if (sb == null) {
sb = new StringBuilder(s);
} else {
...
StringWriter errors = new StringWriter();
e.printStackTrace(new PrintWriter(errors));
logger.error("downalod exception:"+e.getMessage()+"\t"+errors.toString());
monitor 脚本需要 crontab 任务设置,定时来执行。
引用
#!/bin/bash
ps aux|grep java|grep -v grep|awk '{print "kill -9",$2}'|sh
cd /opt/app/ium/bin
nohup ./start-web.sh >/dev/null &
cd /opt/app/ium_wgh/bin
nohup ./start-web.sh >/dev/null &
Linux 删除日志文件 脚本
- 博客分类:
- linux 命令
引用
#!/bin/bash
echo `date +%Y-%m-%d` >> ./rmCharlog.log
find /opt/app/ium/log/system -mtime +1 -exec rm -rf {} \;
find /opt/app/ium_wgh/log/system -mtime +1 -exec rm -rf {} \;
find /usr/local/apache/logs -mtime +1 -exec rm -rf {} \;
echo "************************************************ ...
MySQL 自4.1版以后开始支持INSERT … ON DUPLICATE KEY UPDATE语法,使得原本需要执行3条SQL语句(SELECT,INSERT,UPDATE),缩减为1条语句即可完成。
例如ipstats表结构如下:
CREATE TABLE ipstats (
ip VARCHAR(15) NOT NULL UNIQUE,
clicks SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0'
);
原本需要执行3条SQL语句,如下:
IF (SELECT * FROM ipstats WHERE ip='192.16 ...
环境介绍:主库 192.168.13.13 从库 192.168.0.115
1、主库创建/etc/my.cnf,修改[mysqld]里边的键值打开
server-id = 1
log-bin=mysql-bin
binlog-do-db=temp_db #同步的表
binlog-ignore-db=test #不需要同步的表
2、主库增加 slave用户给权限,用于从库读取主库日志。
grant replication slave,reload,super on *.* to 'slave'@'%' identified by '12345 ...
[root@localhost ~]# rpm -ivh MySQL-client-community-5.1.58-1.rhel5.i386.rpm
error: Failed dependencies:
libncursesw.so.5 is needed by MySQL-client-community-5.1.58-1.rhel5.i386
找一个 ncurses 的 rpm 装上。。
[root@localhost ~]# yum search curses
Loaded plugins: fastestmirror, refresh-packagekit, ...
-- 查找表中多余的重复记录(多个字段)
SELECT * FROM tb_news1 a
WHERE (a.Id,a.TITLE,a.SOURCE,a.DATE) IN
(SELECT a.Id,a.TITLE,a.SOURCE,a.DATE FROM tb_news1 a GROUP BY a.Id,a.TITLE,a.SOURCE,a.DATE HAVING COUNT(1) > 1)
-- 删除表中多余的重复记录(多个字段),只留有rowid最小的记录
DELETE FROM tb_news1 a WHERE
(a.Id,a.TITLE, ...
-- 查找表中多余的重复记录(多个字段)
SELECT * FROM tb_news1 a
WHERE (a.Id,a.TITLE,a.SOURCE,a.DATE) IN
(SELECT a.Id,a.TITLE,a.SOURCE,a.DATE FROM tb_news1 a GROUP BY a.Id,a.TITLE,a.SOURCE,a.DATE HAVING COUNT(1) > 1)
-- 删除表中多余的重复记录(多个字段),只留有id最小的记录
DELETE FROM tb_news1 a WHERE
(a.Id,a.TITLE,a.S ...
Struts2、spring工作原理
- 博客分类:
- JavaEE
Struts2,spring工作原理
Struts2工作原理
阐述struts2的执行流程。
Struts 2框架本身大致可以分为3个部分:核心控制器FilterDispatcher、业务控制器Action和用户实现的企业业务逻辑组件。
核心控制器FilterDispatcher是Struts 2框架的基础 ...
tomcat 远程调试
- 博客分类:
- JavaEE
--------------------
tomcat 远程调试
SET CATALINA_OPTS=-server -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=7777
在startup.sh开始处中增加如下内容:
declare -x CATALINA_OPTS="-server -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,serve ...