星期五, 25 三月 2011

利用JQUERY Autocomplete 插件实现自动提示输入

下载地址: http://bassistance.de/jquery-plugins/jquery-plugin-autocomplete/

要在页面引用如下js库和样式表

jquery.ajaxQueue.js
jquery.autocomplete.css
jquery.autocomplete.js
jquery.bgiframe.min.js
jquery.js
thickbox-compressed.js
thickbox.css 

例如

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>

<title>jQuery Autocomplete Plugin</title>
<script type="text/javascript" src="jquery/jquery.js"></script>
<script type='text/javascript' src='jquery/jquery.bgiframe.min.js'></script>
<script type='text/javascript' src='jquery/jquery.ajaxQueue.js'></script>
<script type='text/javascript' src='jquery/thickbox-compressed.js'></script>
<script type='text/javascript' src='jquery/jquery.autocomplete.js'></script>

<link rel="stylesheet" type="text/css" href="jquery/jquery.autocomplete.css" />
<link rel="stylesheet" type="text/css" href="jquery/thickbox.css" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />   
<script type="text/javascript">
$().ready(function() {
    $("#singleBirdRemote").autocomplete("search.jsp", {
        width: 260,
        selectFirst: true,
        extraParams:{EP1:'一',EP2:'二'}
    });

});
</script>
   
</head>
<body>
    <form autocomplete="off">
            <label>Single Bird (remote):</label>
            <input type="text" id="singleBirdRemote" />
    </form>
   </body>
</html>


一个简单的返回结果的jsp文件

<%@ page contentType="text/html; charset=UTF-8" %>
<%@ page import="java.io.*" %>
<%@ page import="java.util.*" %>
<%@ page import="java.text.*" %>
<%@ page import="java.sql.*" %>
<%@ page import="javax.sql.*" %>
<%@ page import="javax.naming.*" %>
<%
request.setCharacterEncoding("UTF-8");
for (Enumeration names = request.getParameterNames();names.hasMoreElements();) {
    String name = (String)names.nextElement();
    String value = request.getParameter(name);
    System.out.println(name+":"+value);
}
%>
aaa
bbb
ccc
大家好
中国人民解放军

提示:autocomplete会自动将输入框的数据发送到指定的url地址,参数名称为q。

如果需要附加其它参数,可以使用 extraParams 来指定。

要使用UTF-8编码,否则中文会出现乱码。

Posted by xiaojf at 10:39 上午 in 未分类

星期六, 12 三月 2011

Apache Click Table 行号的添加

        Column myColumn = new Column("sn", "序号"){
            protected void renderTableDataContent(Object row, HtmlStringBuffer buffer,Context context, int rowIndex) {
                String sn = Integer.toString(rowIndex);
                buffer.append(sn);
            }
        };
        customerTable.addColumn(myColumn);

重写Column的 renderTableDataContent 方法。

Posted by xiaojf at 6:29 下午 in 未分类

Apache Click Table 行背景颜色的改变

    @Bindable protected Table customerTable = new Table("customerTable"){
        public void addRowAttributes(Map attributes, Object row, int rowIndex) {
            Customer customer = (Customer) row; //取得对象,可根据对象的属性进行相关操作。

            attributes.put("style", "background-color:red;");  
            }
    };

需要重写  addRowAttributes 方法,设置行的style的背景色。

Posted by xiaojf at 6:27 下午 in 未分类

星期日, 27 二月 2011

EL 表达式的隐含变量

The JSP expression language defines a set of implicit objects:

pageContext: The context for the JSP page. Provides access to various objects including:
    servletContext: The context for the JSP page’s servlet and any web components contained in the same application. See Accessing the Web Context.
    session: The session object for the client. See Maintaining Client State.
    request: The request triggering the execution of the JSP page. See Getting Information from Requests.
    response: The response returned by the JSP page. See Constructing Responses.


In addition, several implicit objects are available that allow easy access to the following objects:
    param: Maps a request parameter name to a single value
    paramValues: Maps a request parameter name to an array of values
    header: Maps a request header name to a single value
    headerValues: Maps a request header name to an array of values
    cookie: Maps a cookie name to a single cookie
    initParam: Maps a context initialization parameter name to a single value

Finally, there are objects that allow access to the various scoped variables described in Using Scope Objects.
    pageScope: Maps page-scoped variable names to their values
    requestScope: Maps request-scoped variable names to their values
    sessionScope: Maps session-scoped variable names to their values
    applicationScope: Maps application-scoped variable names to their values

Posted by xiaojf at 10:10 上午 in 未分类

星期六, 19 二月 2011

Hibernate多队夺关系,删除对象时如何清除关系标的关系

        <set name="templets" inverse="false" cascade="save-update" table="gd_tp_ctg">
            <key column="catalog_id"/>
            <many-to-many column="templet_id"
                class="geodesign.db.Templet"/>
        </set>   

 

         <set name="catalogs" inverse="false" cascade="save-update" table="gd_tp_ctg">
            <key column="templet_id"/>
            <many-to-many column="catalog_id"
                class="geodesign.db.TpCatalog"/>
        </set>   

不是级联删除,但是会更新关系标!

Posted by xiaojf at 1:08 下午 in 未分类

星期一, 24 一月 2011

cat /proc/cpuinfo

dev@VM:~$ cat /proc/cpuinfo
processor    : 0
vendor_id    : AuthenticAMD
cpu family    : 16
model        : 6
model name    : AMD Athlon(tm) II X2 220 Processor
stepping    : 3
cpu MHz        : 800.000
cache size    : 512 KB
physical id    : 0
siblings    : 2
core id        : 0
cpu cores    : 2
apicid        : 0
initial apicid    : 0
fpu        : yes
fpu_exception    : yes
cpuid level    : 5
wp        : yes
flags        : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm 3dnowext 3dnow constant_tsc rep_good nonstop_tsc extd_apicid pni monitor cx16 popcnt lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt
bogomips    : 5618.75
TLB size    : 1024 4K pages
clflush size    : 64
cache_alignment    : 64
address sizes    : 48 bits physical, 48 bits virtual
power management: ts ttp tm stc 100mhzsteps hwpstate

processor    : 1
vendor_id    : AuthenticAMD
cpu family    : 16
model        : 6
model name    : AMD Athlon(tm) II X2 220 Processor
stepping    : 3
cpu MHz        : 2800.000
cache size    : 512 KB
physical id    : 0
siblings    : 2
core id        : 1
cpu cores    : 2
apicid        : 1
initial apicid    : 1
fpu        : yes
fpu_exception    : yes
cpuid level    : 5
wp        : yes
flags        : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm 3dnowext 3dnow constant_tsc rep_good nonstop_tsc extd_apicid pni monitor cx16 popcnt lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt
bogomips    : 5618.81
TLB size    : 1024 4K pages
clflush size    : 64
cache_alignment    : 64
address sizes    : 48 bits physical, 48 bits virtual
power management: ts ttp tm stc 100mhzsteps hwpstate

Posted by xiaojf at 1:28 下午 in 未分类

星期日, 23 一月 2011

How to install Guest Additions in CentOS 5.5

log in as root and type in terminal
    yum install gcc -y
    yum install kernel sources -y
    yum install kernel-devel -y

restart the system
now go to the VBox Addition directory in your /media directory and type:

    sh VBoxLinuxAdditions.run

Posted by xiaojf at 11:09 下午 in 未分类

W2K3-64注册码

32λ
JCGMJ-TC669-KCBG7-HB8X2-FXG7M£š¿ÉÔÚÏßÉýŒ¶£©
JB88F-WT2Q3-DPXTT-Y8GHG-7YYQY£šŽòÉϲ¹¶¡ºó¿ÉÍêÃÀÔÚÏßÉýŒ¶£¬ÕŸ³€ÍÆŒö£©
 
KQF2H-284RW-GHXM6-Y3W2B-QWGBB
 
64λ
V893X-4RHCY-6PPH8-8VMT6-W97QT
HMWM9-2883J-HGGGC-FDBRX-XHHQT
# PD6G6-6JFKG-B3KKX-6WPTP-B2PCD
MR78C-GF2CY-KC864-DTG74-VMT73
V893X-4RHCY-6PPH8-8VMT6-W97QT
HMWM9-2883J-HGGGC-FDBRX-XHHQT
PD6G6-6JFKG-B3KKX-6WPTP-B2PCD
BTR9T-8BJJM-K9DH8-W8GRH-7QBQY
BTVTJ-8JDPH-6R8XK-6XHYQ-6QRDY
BTR9X-4X8TY-2Y3W2-JYW3C-TBPMB
BTT8K-DJKYJ-X2M9C-KD6RJ-DB6BB
BT3BY-CMDTC-TWYX3-KFQQQ-G3KVM
BTYQC-347PG-9KB4H-DPHH4-RDWYB
BTV3W-XYB3J-RJ9MF-QBKDW-4QBQY
BTRFK-M749T-F6MY2-8MC6W-G2FDY
* BTV4W-JQX3W-Y6WKP-DXJC7-7QBQY
BTRRD-KPKH6-V9JFQ-C7DV9-9KG7M

Posted by xiaojf at 12:13 下午 in 未分类

星期六, 22 一月 2011

UNIX/Linux 的dd命令可克隆硬盘

10台配置相同的机器,安装了Ubuntu 10。

利用Ghost克隆,发现不行。查了一下,使用dd命令,就可以。Linux的工具真是丰富!

Posted by xiaojf at 1:10 上午 in 未分类

星期二, 28 十二月 2010

EditPlus 3.2 注册码

Name:kariryo
Code: 5387D-12450-BCZ8B-D6W0B-85TE1
Name:www.orsoon.com
Code: CC3AA-12318-54Z8C-87W50-58TE5

Posted by xiaojf at 1:20 下午 in 未分类

星期一, 27 十二月 2010

win2k3 企业版序列号

HXCRB-TQW9R-42JK8-TQ7X2-PJRDY

Posted by xiaojf at 1:58 下午 in 未分类

星期日, 26 十二月 2010

如何去掉浏览器打印时的页眉和页脚

文件->页面设置。 将有关页眉和页脚的格式信息去掉即可。

Posted by xiaojf at 6:23 下午 in 未分类

星期三, 22 十二月 2010

Ready for new year!

Oracle

Posted by xiaojf at 10:22 上午 in 未分类

星期一, 20 十二月 2010

Oracle 10g 安装截图

Posted by xiaojf at 4:22 下午 in 未分类

星期五, 10 十二月 2010

使用 StAX 解析 XML

第 1 部分: Streaming API for XML (StAX) 简介
第 2 部分: 拉式解析和事件
第 3 部分: 使用定制事件和编写 XML

Posted by xiaojf at 10:56 下午 in 未分类

星期一, 6 十二月 2010

Oracle ResultSet.TYPE_SCROLL_INSENSITIVE 乱码

Oracle 库,列编码是iso-8859-1,存储的是中文。

使用 new String(rs.getString(1).getBytes("iso-8859-1"),"gb2312")

stmt = conn.createStatement()  正常

stmt = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE ,ResultSet.CONCUR_READ_ONLY )  还是乱码

原因,暂时没有查出。

Posted by xiaojf at 10:06 下午 in 未分类

星期六, 4 十二月 2010

Java文件采用UTF-8编码时,在Windows下编译提示非法字符的问题

需要为javac任务添加encoding参数。

      <target name="compile" depends="clean">
        <javac srcdir="${basedir}/src" encoding="utf-8"
           debug="on"
           deprecation="on"
           optimize="off"
           includes="**"
           includeantruntime="on">
           <classpath refid="classpath"/>
           <compilerarg value="-Xlint:unchecked"/>
        </javac>
      </target>

Posted by xiaojf at 4:35 下午 in 未分类

星期一, 22 十一月 2010

Raphael - javascript小型矢量图形库

  Raphael 可以简化你在web上做矢量图的工作。如果你想创建你自己的图表、图形或者旋转部件,你可以使用这个库轻松的完成这个工作。

  Raphael使用SVG W3C Recommendation 和 VML 作为基础来创建图形。这意味着每一个你创建的图形也是一个DOM对象,你也可以附加JavaScript事件来改变他们的行为。

  Raphael当前支持 Firefox 3.0+, Safari 3.0+, Chrome 5.0+, Opera 9.5+ 和 Internet Explorer 6.0+。

Posted by xiaojf at 9:58 上午 in 未分类

星期六, 13 十一月 2010

Jsoup - Java HTML 分析器

Jsoup

Posted by xiaojf at 1:22 下午 in 未分类

星期日, 7 十一月 2010

CentOS更新源国内镜像

http://mirrors.sohu.com/help/centos.html

http://mirrors.163.com/.help/centos.html

Posted by xiaojf at 1:25 下午 in 未分类

« First  « Prev   1 2 3 4 5   Next »  Last »