2011-12-12 ~ 2011-12-16一些笔记

来源:互联网 发布:淘宝马甲工服 编辑:程序博客网 时间:2024/06/15 02:20

1.  <c:out>标签的作用是用来显示表达式的值。它的作用是用来替代通过JSP内置对象out或者<%=%>标签来输出对象的值。

    <c:out>标签的语法说明如下:
    <c:out value="expression" default="expression" escapeXml="boolean"/>
    <c:out>标签具有以下一些属性:

         value:用来定义需要求解的表达式。

         default:缺省值。当求解后的表达式为null或者String为空时将打印这个缺省值。

         escapeXML:这个属性是可选的。

         用于指定在使用<c:out>标记输出诸如"<"、">;"和"&"之类的字符(在 HTML 和 XML 中具有特殊意义)时是否应该进行转义。

         如果将 escapeXml 设置为true,则会自动的进行编码处理。


2.  == (相等)与 === (严格相等)的区别在于恒等运算符在比较前强制转换不同类型的值
    可以做如下概括:

    ==运算符在做比对时存在类型转换的可能,而===运算符只在同类型之间比对,是==的严格模式。


    1.类型相同:进行===比对。


    2.类型不同:基本类型Boolean、Number、String这三者之间做比较时,总是向Number进行类型转换,然后再比较;

               如果类型有Object,那么将Object转化成基本类型,再进行比较;null仅和undefined匹配;其他都为false。


    根据规范和概括,我们不难明白:

    undefined只等于(==)undefined或null,null亦然
    空字串(") == 0 == false ,因为Number("),Number(false) : 0
    true == 1 ,因为Number(true) : 1
    false===0 一定返回flase ,因为类型不同

    恒等必定等同,等同未必恒等,需择之而用!
    参考:http://kevazhang.host.92fw.cn/index.php/archives/javascript_same.html


3.java 序列化

The stream-unique identifier is a 64-bit hash of the class name, interface class names, methods, and fields.


4.ibatis有两种方式,一种是#,一种是$。

用preparestatment来实现的时候是这样的。凡是#的,都作为参数,用setobject方式。

而$方式的,则直接替换字符串。 所以。 


select col1,col2 from table1 where col1=#col1# and col2 like '$col2$' 
假如参数是col1=2 col2=2 
最终的SQL就是 select col1,col2 from table1 where col1=? and col2 like '2' 

如果需要通符,则用 like '%$col2$%'


5.Extjs4

margin padding  盒子模型

window或者panel按钮对齐


buttonAlign : String

The alignment of any buttons added to this panel. Valid values are 'right', 'left' and 'center' (defaults to 'right' for buttons/fbar, 'left' for other toolbar types).

NOTE: The newer way to specify toolbars is to use the dockedItems config, and instead of buttonAlign you would add the layout: { pack: 'start' | 'center' | 'end' } option to the dockedItem config.



Ext4  grid行的提示信息   设置属性:data-qtip
eg:
renderer:function(data){
    return "<span data-qtip='" + data + "'>" + data + "</span>";

}


6.PrintWriter

public PrintWriter(OutputStream out,                   boolean autoFlush)
Creates a new PrintWriter from an existing OutputStream. This convenience constructor creates the necessary intermediate OutputStreamWriter, which will convert characters into bytes using the default character encoding.

Parameters:
out - An output stream
autoFlush - A boolean; if true, the println, printf, orformat methods will flush the output buffer