会用到不一定记得的方法1

--调整JS换行
<c:out value="12<br/>12" escapeXml="false"></c:out>  struts2的标签
${fn:escapeXml(strVar)} 刘佳兴说的方法
${fn:escapeXml(param:info)}

JS全局替换字符串中的!  /g表示全局的
transferPayeeIsCheckTips = transferPayeeIsCheckTips.replace(/\!/g ,'!\n\r');

--修改tomcat的内存
tomcat-6.0.16\bin  下面的 catalina.bat
在@echo off下面添加一行
set JAVA_OPTS=-Xms1024m -Xmx1024m -XX:PermSize=256m -XX:MaxPermSize=256m

--加锁的方法,判断用户是否被锁住
String lockResult = LockResourceManager.lockKey(lockKey, new StringBuffer("用户[")
.append(this.getCurrentUser(request).getRealname()).append("]正在提交该组织区间定期存款利息预提数据, 请稍候操作..").toString());
if(null != lockResult) {
this.write(response, "error[split]" + lockResult);
return null;
}

--格式化金额
/**
* 格式化金额
* @param num
* @return
*/
private String formatMoney(Object num){
DecimalFormat f = new DecimalFormat("#,###,###,##0.00");
return f.format(num);
}

--计算大数且取两位精确度的数字
new BigDecimal(sum).setScale(2, BigDecimal.ROUND_HALF_UP).toPlainString()

--C标签循环MAP
<c:forEach items="${shoppingCart}" var="map"> 
  <tr> 
    <td>${map.key}</td> 
    <td>${map.value.number }</td> 
    <td>${map.value.price }</td> 
  </tr> 
</c:forEach>

--初始化密码
public static void main(String[] args) {
String a = encrypt("lidan" ,"888888" ,"2012-08-08 09:53:51");
System.out.print(a);
}

--修改treat类型
dhtmlXGridSky.js

eXcell_rmbtreat.prototype = new eXcell;
eXcell_rmbtreat.prototype.setValue = function(val){
var a = val.split(";");
for(var i=0;i<a.length;i++){
var value = a[i].split("#");
if(i==0){
this.cell.innerHTML = "&nbsp;<a style='cursor:hand;color:green' onclick="+value[1]+"('"+value[2]+"')>"+value[0]+"</a>";
}else{
this.cell.innerHTML += "&nbsp;&nbsp;<a style='cursor:hand;color:green' onclick="+value[1]+"('"+value[2]+"')>"+value[0]+"</a>";
}
}
}

--checkbox的用法
eXcell_ch8.prototype = new eXcell;
eXcell_ch8.prototype.setValue = function(val){
val = val.split("#");

if(val[1] == "true"){
this.cell.innerHTML = "<div style='text-align:center;position:relative;padding-right:2px;width:100%;'><input type='checkbox' id='checkbox1' name='checkbox1' value='" + val[0] + "' checked onclick='selectSingle(this,checkbox2)'/></div>";
}else{
this.cell.innerHTML = "<div style='text-align:center;position:relative;padding-right:2px;width:100%;'><input type='checkbox' id='checkbox1' name='checkbox1' value='" + val[0] + "' disabled onclick='selectSingle(this,checkbox2)'/></div>";
}
}

当类型为 isChecked 的时候 显示的是是否显示,而且不能被改动

--checkbox复选框设置的方法
eXcell_ch8.prototype = new eXcell;
eXcell_ch8.prototype.setValue = function(val){
val = val.split("#");
if(val[1] == "true"){
this.cell.innerHTML = "<div style='text-align:center;position:relative;padding-right:2px;width:100%;'><input type='checkbox' id='checkbox1' name='checkbox1' value='" + val[0] + "' checked onclick='selectSingle(this,checkbox2)'/></div>";
}else{
this.cell.innerHTML = "<div style='text-align:center;position:relative;padding-right:2px;width:100%;'><input type='checkbox' id='checkbox1' name='checkbox1' value='" + val[0] + "' onclick='selectSingle(this,checkbox2)'/></div>";
}
}

猜你喜欢

转载自2594082lhj.iteye.com/blog/1694081