工作中小细节总结(六)

101 删除、添加行
页面:
<table width="98%" id="quanshuTalbe" cellpadding="4" cellspacing="1" border="0" class="blueline">
<tr>
<td height="24" colspan="3" align="left" class="bluehead" style="font: bold;">权属证书信息详细</td>
</tr>
<tr>
<td height="23" class="bluebg"  width="40%" align="center">权属证书类型</td>
<td height="23" class="bluebg"  width="40%" align="center">权属证书号</td>
<td height="23" class="bluebg"  width="10%" align="center">操作</td>
</tr>
<tr>
<td height="23" class="whitebg" align="center">
<select name="quanshuType" id="quanshuType">
<option value="">请选择</option>
<option value="著作权质押登记证书">著作权质押登记证书</option>
<option value="房屋他项权证">房屋他项权证</option>
<option value="在建工程抵押登记证明">在建工程抵押登记证明</option>
</select>
</td>
      <td height="23" class="whitebg" align="center">
<input type="text" name="quanshuId" id ="quanshuId" style="width: 180px;" value="" />
</td>
      <td height="23" class="whitebg" align="center">
      <img src="../../../res/img/add.bmp" title="加添权属证书" alt="加添权属证书" style="cursor: pointer;" onclick="add();"/>
      </td>
</tr>
<tr>
<td height="23" class="whitebg" align="center">
房屋他项权证
</td>
<td height="23" class="whitebg" align="center">
wdfsdyj3
</td>
<td height="23" class="whitebg" align="center">
<img src='../../../res/img/del.bmp' title='删除权属证书' alt='加添权属证书' style='cursor: pointer;' onclick='deleteRow(this);'/>
</td>
</tr>

</table>


JavaScript:
function add(){
var table = document.getElementById('quanshuTalbe');
var i = table.rows.length;

var row= table.insertRow(i);
row.setAttribute('class','whitebg');
row.align="center";
row.height="23";
row.insertCell(0).innerHTML = document.getElementById('quanshuType').value;

row.insertCell(1).innerHTML = document.getElementById('quanshuId').value;
row.insertCell(2).innerHTML = "<img src='../../../res/img/del.bmp' title='删除权属证书' alt='加添权属证书' style='cursor: pointer;' onclick='deleteRow


(this);'/>";
}


function deleteRow(obj)
{
obj.parentNode.parentNode.parentNode.removeChild(obj.parentNode.parentNode);

}

102  BigDecimal serialNo = BigDecimal.valueOf(Double.valueOf(new SimpleRandomKeyGen().getNext10(conn)));




   生成一个唯一的序号,YYYYMMDDHHMI + 8位数字   SimpleRandomKeyGen.java
/**
* 获取序号格式为 YYYYMMDDHH24MI+8位数字
* @param conn
* @return
*/
public String getNext(Connection conn)
{
String sql = "SELECT FUNC_GET_UNIQUE_ID(20) FROM DUAL";
try
{
return DBUtil.findSingleColumn(conn, sql, null, String.class);
}
catch (SQLException e)
{
throw new RuntimeException("生成唯一序号失败", e);
}
}







    /* 创建序列*/
    create sequence SEQ_RANDOM
    minvalue 1
    maxvalue 99999999
    start with 4461003
    increment by 1
    cache 10000
    cycle;




    /*创建函数*/
    create or replace function FUNC_GET_UNIQUE_ID (LEN in integer)
                                                     return varchar2 is
      Result varchar2(20);
    begin
      IF 20=LEN THEN
        SELECT to_char(sysdate, 'YYYYMMDDHH24MI') ||
             ltrim(TO_CHAR(seq_random.nextval, '09999999'))
        INTO Result
        FROM dual;
      ELSIF 10=LEN THEN
        SELECT to_char(sysdate, 'MMDD') ||
             ltrim(TO_CHAR(SEQ_RANDOM_6.nextval, '099999'))
        INTO Result
        FROM dual;
      END IF;
      return(Result);


    end;

103  方法中定义的临时引用,不使用时 置为NULL
public void attributeRemoved(HttpSessionBindingEvent event)
{
Object val = event.getValue();
if (null != val && ActionHelp.SESSION_USER.equals(event.getName())
&& val instanceof UserBean)
{
getCurrentUsers().remove(event.getSession().getId());
}
val = null;
}


104  作为一名库设计者,应将所有东西都尽可能保持"private"(私有),并只展示出那些想让顾客程序员使用的方法

105  XML中的特殊字符
在 XML 中有 5 个预定义的实体引用:
&lt; < 小于 
&gt; > 大于 
&amp; & 和号 
&apos; ' 省略号 
&quot; " 引号 

106  导出页面内容(详情参见导出EXCEl文件/makeexcel.jsp)


<%
response.setContentType("application/vnd.ms-excel; charset=UTF-8");
response.setHeader("Content-disposition", "attachment; filename=" + java.net.URLEncoder.encode("纪念币预约结果(" + SzbocTool.getSysDateToStr() + ").xls", "utf-8"));
%>

107  Tomcat 问题 【JAXB classNotFoundException  com.sun.XML.bind.v2.ContextFactory 】
      
JDK 版本不一致
 
Tomcat 6.0\endorsed 包括了一个jaxb-api-2.1.jar 

108  UE窗口显示问题
     视图--》视图/列表--》打开

109  更换了eclipse版本,工作空间使用原来的,SVN不能使用
     需team-》upgrade

110 oracle导出的数据有科学计数法问题
    建议导出txt格式或者使用to_char函数

扫描二维码关注公众号,回复: 2148140 查看本文章

111 oracle 正则  regexp_like
    --分笔退回
-- 1225
select *
  from td_daily_account_response_new t
 where t.tran_date = '20151225'
   and t.usage_name like '%分笔退回%'
   and t.ac_no_ds = '743264190893'
   and regexp_like(t.jrnlno,
                   '(98544304)|(98543909)|(98545613)|(98610581)|(98614063)|(98616365)');
-- 1215                  
select *
  from td_daily_account_response_new t
 where t.tran_date = '20151215'
   and t.usage_name like '%分笔退回%'
   and t.ac_no_ds = '743264190893'
   and regexp_like(t.jrnlno,
                   '(178818547)|(178821589)|(178823496)|(178826592)|(178831630)|(178834571)|(178837574)');

112 dax error  access violation at address 错误解决
    -- 错误“使用 sfc /scannow命令 解决了”
使用管理员权限运行IE 可以查看

113  throws 和 throw 的区别

114  private String 和 private static final String 

115 StringBuffer 线程安全 同步
    StringBuild  性能高些 异步

116  shero、
权限校验

117  noclassdeffounderror 错误
     Tomcat下少了javaee.jar包

118  c标签
        <c:if test="${'10' == info.curStatus }">
    <td>已审批</td> 
</c:if>

119 <logic:equal name="msgForm" property="opType" value="22">劳务费</logic:equal>

120 弹出框
    //本年累次 详细信息
function showDetailDialog(personUid,licenceType,seqNo){
var sUrl = "<%=path%>/personmanage/goAbroad/deptApprove.do?method=showYearNumList&transID=03-03-04&type=org&personUid=" +personUid


+"&licenceType="+licenceType+"&seqNo="+seqNo;
showInModalDialog(sUrl,null,"800px","700px","no","no");
}

window.open

猜你喜欢

转载自blog.csdn.net/qq_35079856/article/details/77141538