- 浏览: 3158377 次
- 性别:
- 来自: 北京
最新评论
-
happyqing:
skyshowshow 写道[b][/b]DTO类呢baseD ...
Java打印条码,使用佳博条码打印机 -
skyshowshow:
[b][/b]DTO类呢baseDto呢
Java打印条码,使用佳博条码打印机 -
happyqing:
一般使用公钥加密,私钥解密。
java RSA加密生成license,用CPU序列号生成机器码 -
allmyteacher:
楼主。使用分布式session后,能解决freemarker无 ...
spring session redis 配置 -
masuweng:
代码报异常啊
纯java获取CPU序列号,生成机器码
文章列表
import java.util.Random;
import java.util.UUID;
/**
* 生产指定长度随机字符串a-z,A-Z,0-9
* @author happyqing
* @since 2016.5.30
*/
public class RandomString {
/**
* 获取随机字符串 a-z,A-Z,0-9
* @param length 长度
* @return
*/
public static String getRandomString(int length) {
String ...
一、基本命令
查看状态 service iptables status
启动:service iptables start
重启:service iptables restart
关闭:service iptables stop
如果查看状态和启动没有任何反应,说明没有配置过防火墙
查看配置文件
vi /etc/sysconfig/iptables
二、重新配置防火墙
1.查看规则
[root@dev ~]# iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source ...
一、设置jvm内存大小
打开管理控制台 https://ip:9043/ibm/console服务器--应用程序服务器--选择服务器server1--Java和进程管理--进程定义--Java虚拟机初始堆大小 4096 M最大堆大小 4096 M
二、设置数据库连接池
可以使用 WAS 管理控 ...
web_add_header("xxx", "yyy");
web_add_auto_header("xxx", "yyy");
max_clients = worker_processes * worker_connections
worker_processes number|auto
worker_processes 4; //可以设置成auto,也可设置1到cpu个数或核数,不要超过cpu核数
The auto parameter is supported starting from versions 1.3.8 and 1.2.5.
worker_rlimit_nofile 65535; 进程的最大打开文件数限制。这样nginx就不会有“too many open files”问题了。
...
压力测试
日期和数字格式化对象是非线程安全的
DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
DateFormat、SimpleDateFormat是非线程安全的,不要放在类属性上,在方法里new
数字格式化,这个也是非线程安全的,
DecimalFormat dft = new DecimalFormat("#0.00");
使用共享库可解决jar包冲突的问题
websphere7.0 jar包冲突解决办法,类加载顺序http://happyqing.iteye.com/blog/2323301
一、创建共享库
was控制台
环境--共享库
1.新建共享库
2.配置名称、类路径类路径可以写目录,这样就不用挨个写jar包了,方便添加删除jar包
创建好共享库后需要重启server
共享库类路径可以引用was外的,cell下,项目下,建议放cell下
放在共享库的jar包需要依赖的jar包要一并放入,
如果报java.lang.NoClassDefFoundError,缺啥放啥 ...
本文以windows版websphere为样例
本文主要解决的是同一个web模块(web项目)下,有两个jar包里含有相同的包名类名的类,造成加载的类错误的问题(其他的也可以解决)
(附件中提供,查看类加载于哪的jsp)
其实解决这种问题最简单的办法就是,把想优先使用的jar包,解压成class,优先加载class。
websphere一个web模块下jar包加载的顺序,只能看,不能改,似乎可以尝试改jar名的方式调整jar包加载顺序,
websphere linux和windows版,不同补丁版本,加载的顺序可能是不同的,有的是乱序的,有的是按文件名排序的。乱序的是真 ...
登陆WAS管理控制台,
打开:服务器->应用程序服务器->server1->进程定义->java虚拟机->通用JVN参数;填入如下内容:-Dfile.encoding=UTF-8 -Ddefault.client.encoding=UTF-8
websphere7.0下载升级程序和补丁及安装http://happyqing.iteye.com/blog/2026258
cd /opt/IBM/WebSphere/UpdateInstaller
./update.sh
如果用shell工具执行命令打不开图形界面,
实在不行,可在远程服务器桌面操作,或连接到服务器远程桌面
window用Xmanager4.0的Xstart连接linux远程桌面http://happyqing.iteye.com/blog/2005711
easyui datagrid 跨页抉择
http://www.myexception.cn/open-source/1838292.html
一、java实现
权限filter里加入
PrintWriter out = response.getWriter();
out.write("<script>top.location.href='"+request.getContextPath() + "/login"+"'</script>");
此种方法有一个优点,不用向服务器请求两次login页面
二、js实现
在login页面加入
<script type="text/javascript"&g ...
配置片段
error_page 404 /404.html; location = /404.html { root html; }
# redirect server error pages to the static page /50x.html # error_page 500 502 503 504 /50x.html; location = /50x.html { root html; ...
报错:
upstream timed out (110: Connection timed out) while reading response header from upstream
设置代理超时:
proxy_connect_timeout 65s; #连接超时 默认为60秒proxy_read_timeout 65s; #读取超时 默认为60秒proxy_send_timeout 65s; #发送超时 默认为60秒
Syntax: proxy_connect_timeout time;Default: proxy_connect_timeout 60s;Co ...
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStrea ...