易截截图软件、单文件、免安装、纯绿色、仅160KB

JSP/JAVA 编程参考

第1条  How to Write an Equality Method in Java  
http://www.artima.com/lejava/articles/equality.html
How to Write an Equality Method in Java
by Martin Odersky, Lex Spoon, and Bill Venners
June 1, 2009
Summary
This article describes a technique for overriding the equals method that preserves the contract of equals even when subclassses of concrete classes add new fields.
In Item 8 of Effective Java1, Josh Bloch describes the difficulty of preserving the equals contract when subclassing as a “fundamental problem of equivalence relations in object-oriented languages.” Bloch writes:
There is no way to extend an instantiable class and add a value component while preserving the equals contract, unless you are willing to forgo the benefits of object-oriented abstraction.
Chapter 28 of Programming in Scala shows an approach that allows subclasses to extend an instantiable class, add a value component, and nevertheless preserve the equals contract. Although in the technique is described in the book in the context of defining Scala classes, it is also applicable to classes defined in Java. In this article, we present the technique using text adapted from the relevant section of Programming in Scala, but with the code examples translated from Scala into Java.
第2条 jsp使用URL编码传递中文参数问题
http://blog.csdn.net/jxcjxinxing/archive/2007/12/30/1469924.aspx
Jsp页面使用URL编码传递中文参数的情况下,在参数的解析过程中会出现乱码。由于java在设计的时候考虑到了国际化的问题,在java源程序编译成字节码的时候默认使用的是UTF-8编码。而在web运用上,由于不同的浏览器向服务器发送的信息采用的编码方式不同,在由像tomcat之类的服务器解码的时候会由于编码方式的不同而产生乱码,这是一个会困扰jsp初学者很久的问题。
举例说明:
    String sContent = "中文 参数";
    如果不做任何处理就直接传递,中文也许没有问题(但不保证),但空格肯定会有问题,到接收页面无法识别。
解决办法1:
java.net.URLEncoder.encode(sContent,"gb2312"); 然后再


相关文档:

JAVA程序员的钱途

      清华大学出版社《Java程序员,上班那点事儿》作者:钟声 章节:1.1小节
      我们刚刚进入本书的正题就拿出一个俗不可耐“钱”字来和大家大谈特谈,未免不雅。但是,我还是要在一开始就要说这个问题,因为这是很多朋友关心的问题,为什么不先说 ......

Berkeley DB JAVA版本中,类增强器的使用

据文档所说,类增强器比用代理的方式速度上有优势。
有两种方式,
第一种是在类加载时动态处理,这个对现有程序不用修改。只需要改下运行的java脚本即可
对于Java 1.5如下所示
java -javaagent:lib/je-<version>.jar=enhance:packageNames ...
je-<version>.jar 就是Berkeley DB JAVA库的名字。 packageNa ......

Mozilla将针对恶意Java插件进行屏蔽

   据国外媒体报道,Mozilla已经针对Firefox设置了一个恶意Java插件屏蔽黑名单。
  据安全博客Brian Krebs介绍,上周甲骨文公司发布了一个修复Java插件漏洞的更新,但是Mozilla开发人员发现,这个更新没有删除旧版本的代码,使得系统仍然留下了漏洞代码,从而使得遗留代码成为新的漏洞。对此,Mozilla不得不将屏� ......

JAVA学习笔记(一) 异常处理

异常是指程序运行期间出现的问题。在写程序时,确实可以写代码测试程序是否正确执行,如果没有执行,则执行错误处理。尽管这种形式的错误处理能够起到作用,但程序逻辑与错误处理一起混用,会使得程序难以阅读‘修改。如果潜在的问题极少发生,则混用程序和错误处理逻辑讲降低程序的性能。异常处理使程序员能够从程序� ......

Java笔试题【转】

1.写出程序运行结果
  
public
class
TestString {
    public
static
void
link(String a){
         a+="World"
;
    }
    public
static
void
main(String []a ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号