原创 表單中用JS禁止某些符號的輸入
將禁止輸入的符號用空格替換掉,下面是個禁止輸入百分號的例子: οnkeyup="this.value=this.value.replace(/[%]/,'');"
原创 獲取 Select 值
var slt = document.getElementById("selectId") slt .options[slt.selectedIndex].text // IE 6、FireFox都可用 slt .value // IE
原创 Iframe仿Ajax異步上傳文件(圖片)
JSP: <form name="mainForm" id="mainForm" method="post" enctype="multipart/form-data"> 上傳圖片 <input type="file" nam
原创 Servlet中調用Spring管理的Bean
ServletContext servletContext = this.getServletContext(); WebApplicationContext wac = WebApplicationContextUtils.getR
原创 JS可拖動層
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dt
原创 Spring 發送郵件
public void sendEmail(String email, String message,String subject) throws SendFailedException { try { Properties pr
原创 性能優化相關
cpu分析工具 https://github.com/jvm-profiling-tools/async-profiler
原创 清空 File
document.getElementById("fileID").outerHTML=document.getElementById("fileID").outerHTML;IE 6 有效document.getElementById(
原创 jquery.truncate省略顯示(類alt/title提示)
1、引入Jquery: <script type="text/javascript" src="js/jquery-1.4.2.min.js"></script> <script type="text/javascript" src="j
原创 Java實現快速排序
public class QuickSort { private long[] arr; //要排序的數組 private int size; //初始化數組大小 private int length; //數組實際大小(即有多少個
原创 Eclipse下修改項目名稱
1:修改項目目錄下:.project文件 <?xml version="1.0" encoding="UTF-8"?> <projectDescription>
原创 希爾排序和快速排序的效率比較
希爾排序和快速排序的效率比較:對於無序數組,【希爾排序】完勝【快速排序】(當然也可能本人算法實現的不好) 用本人寫的代碼進行測試------------ 100w隨即無序數組 希爾排序:1ms完成 快速排序:6s完成 10
原创 Servlet中調用 Spring管理的 Service層方法(SSH框架中)
ServletContext servletContext = this.getServletContext(); WebApplicationContext wac = null; wac = WebApplicationC
原创 Java實現希爾(Shell)排序
import java.text.SimpleDateFormat; import java.util.Date; public class ShellSort { private long[] arr; //要排序的數組 priv
原创 常用命令
./resin.sh -server helloworld stop/start