]]>java foundationhttp://www.aygfsteel.com/Jcat/archive/2007/05/23/119499.htmlJcatJcatWed, 23 May 2007 14:35:00 GMThttp://www.aygfsteel.com/Jcat/archive/2007/05/23/119499.htmlhttp://www.aygfsteel.com/Jcat/comments/119499.htmlhttp://www.aygfsteel.com/Jcat/archive/2007/05/23/119499.html#Feedback0http://www.aygfsteel.com/Jcat/comments/commentRss/119499.htmlhttp://www.aygfsteel.com/Jcat/services/trackbacks/119499.html equals in String
publicboolean equals(Object anObject) { if (this== anObject) { returntrue; } if (anObject instanceof String) { String anotherString = (String)anObject; int n = count; if (n == anotherString.count) { char v1[] = value; char v2[] = anotherString.value; int i = offset; int j = anotherString.offset; while (n--!=0) { if (v1[i++] != v2[j++]) returnfalse; } returntrue; } } returnfalse; }
]]>environment variable for java, groovy, ant and etc.http://www.aygfsteel.com/Jcat/archive/2007/05/23/119491.htmlJcatJcatWed, 23 May 2007 13:39:00 GMThttp://www.aygfsteel.com/Jcat/archive/2007/05/23/119491.htmlhttp://www.aygfsteel.com/Jcat/comments/119491.htmlhttp://www.aygfsteel.com/Jcat/archive/2007/05/23/119491.html#Feedback0http://www.aygfsteel.com/Jcat/comments/commentRss/119491.htmlhttp://www.aygfsteel.com/Jcat/services/trackbacks/119491.htmlJAVA_HOME
some official definitions: What is the Apache HTTP Server? * is a powerful, flexible, HTTP/1.1 compliant web server * implements the latest protocols, including HTTP/1.1 (RFC2616) * is highly configurable and extensible with third-party modules * can be customised by writing 'modules' using the Apache module API * provides full source code and comes with an unrestrictive license * runs on Windows 2003/XP/2000/NT/9x, Netware 5.x and above, OS/2, and most versions of Unix, as well as several other operating systems
What is the Apache Tomcat? Apache Tomcat is the servlet container that is used in the official Reference Implementation for the Java Servlet and JavaServer Pages technologies. The Java Servlet and JavaServer Pages specifications are developed by Sun under the Java Community Process. Apache Tomcat is developed in an open and participatory environment and released under the Apache Software License.
]]>input data from cmdhttp://www.aygfsteel.com/Jcat/archive/2007/02/04/97871.htmlJcatJcatSun, 04 Feb 2007 11:24:00 GMThttp://www.aygfsteel.com/Jcat/archive/2007/02/04/97871.htmlhttp://www.aygfsteel.com/Jcat/comments/97871.htmlhttp://www.aygfsteel.com/Jcat/archive/2007/02/04/97871.html#Feedback0http://www.aygfsteel.com/Jcat/comments/commentRss/97871.htmlhttp://www.aygfsteel.com/Jcat/services/trackbacks/97871.htmlimport java.io.InputStreamReader; import java.io.BufferedReader; import java.io.IOException;
]]>The ultimate webdesign usability checklisthttp://www.aygfsteel.com/Jcat/archive/2007/01/25/95893.htmlJcatJcatThu, 25 Jan 2007 04:39:00 GMThttp://www.aygfsteel.com/Jcat/archive/2007/01/25/95893.htmlhttp://www.aygfsteel.com/Jcat/comments/95893.htmlhttp://www.aygfsteel.com/Jcat/archive/2007/01/25/95893.html#Feedback0http://www.aygfsteel.com/Jcat/comments/commentRss/95893.htmlhttp://www.aygfsteel.com/Jcat/services/trackbacks/95893.html
I noticed that I, and fellow
webdesigners, keep making the same usability mistakes over and over.
This checklist with 88 questions is a must read for every webdesigner
who cares about usability.
This website, NotUsable.com, is not designed by me. Giving me the perfect excuse why this website doesn’t pass my own usability checklist. But I would love to hear your comments and don’t forget to let me know when you can answer the whole checklist with ‘yes?
Note that my design company is called Achtentachtig, which means Eighty Eight in Dutch, that’s why there are 88 questions in this checklist. Just to let you know.
]]>online status indicatorhttp://www.aygfsteel.com/Jcat/archive/2006/12/20/88968.htmlJcatJcatWed, 20 Dec 2006 01:34:00 GMThttp://www.aygfsteel.com/Jcat/archive/2006/12/20/88968.htmlhttp://www.aygfsteel.com/Jcat/comments/88968.htmlhttp://www.aygfsteel.com/Jcat/archive/2006/12/20/88968.html#Feedback0http://www.aygfsteel.com/Jcat/comments/commentRss/88968.htmlhttp://www.aygfsteel.com/Jcat/services/trackbacks/88968.htmlQQ
<script language="javascript" type="text/javascript"> var second = document.getElementById('totalSecond').textContent; setInterval("redirect()", 1000); function redirect() { document.getElementById('totalSecond').textContent =--second; if (second <0) location.href = '02view.html'; } </script>
4Q解决Firefox不支持innerText的问?br />
<span id="totalSecond">5</span>
<script language="javascript" type="text/javascript"> if(navigator.appName.indexOf("Explorer") >-1){ document.getElementById('totalSecond').innerText ="my text innerText"; } else{ document.getElementById('totalSecond').textContent ="my text textContent"; } </script>
5Q整?Q和3'Q?br />
<span id="totalSecond">5</span>
<script language="javascript" type="text/javascript"> var second = document.getElementById('totalSecond').textContent;
if (navigator.appName.indexOf("Explorer") >-1) { second = document.getElementById('totalSecond').innerText; } else { second = document.getElementById('totalSecond').textContent; }
http://ant.apache.org/ Apache Ant is a Java-based build tool. In theory, it is kind of like Make, but without Make's wrinkles. http://lucene.apache.org/ Apache Lucene is a high-performance, full-featured text search engine library written entirely in Java. It is a technology suitable for nearly any application that requires full-text search, especially cross-platform.
http://jakarta.apache.org/velocity/index.html Velocity is a Java-based template engine. It permits anyone to use a simple yet powerful template language to reference objects defined in Java code.
Sourceforge
http://junit.sourceforge.net/ JUnit is a simple framework to write repeatable tests. It is an instance of the xUnit architecture for unit testing frameworks.
http://httpunit.sourceforge.net/ HttpUnit makes you easy to be able to bypass the browser and access your site from a program. When combined with a framework such as JUnit, it is fairly easy to write tests that very quickly verify the functioning of a web site.
http://dozer.sourceforge.net/ Dozer is a powerful, yet simple Java Bean to Java Bean mapper that recursively copies data from one object to another. Typically, these Java Beans will be of different complex types.
http://xdoclet.sourceforge.net/xdoclet/index.html XDoclet is an open source code generation engine. It enables Attribute-Oriented Programming for java. In short, this means that you can add more significance to your code by adding meta data (attributes) to your java sources. This is done in special JavaDoc tags.
http://displaytag.sourceforge.net The display tag library is an open source suite of custom tags that provide high-level web presentation patterns which will work in an MVC model. Actually the display tag library can just... display tables! Give it a list of objects and it will handle column display, sorting, paging, cropping, grouping, exporting, smart linking and decoration of a table in a customizable XHTML style.
http://cglib.sourceforge.net/ cglib is a powerful, high performance and quality Code Generation Library, It is used to extend JAVA classes and implements interfaces at runtime.
Others
http://www.opensymphony.com/compass/ Compass is a first class open source Java Search Engine Framework, enabling the power of Search Engine semantics to your application stack decoratively. Built on top of the amazing Lucene Search Engine, Compass integrates seamlessly to popular development frameworks like Hibernate and Spring.
http://www.opensymphony.com/quartz/ Quartz is a full-featured, open source job scheduling system that can be integrated with, or used along side virtually any J2EE or J2SE application - from the smallest stand-alone application to the largest e-commerce system.
http://groovy.codehaus.org/ Groovy is an agile dynamic language for the Java Platform with many features that are inspired by languages like Python, Ruby and Smalltalk, making them available to Java developers using a Java-like syntax.
http://www.singularsys.com/jep/ JEP is a Java library for parsing and evaluating mathematical expressions. With this package you can allow your users to enter an arbitrary formula as a string, and instantly evaluate it. JEP supports user defined variables, constants, and functions. A number of common mathematical functions and constants are included.
http://www.dom4j.org/ dom4j is an easy to use, open source library for working with XML, XPath and XSLT on the Java platform using the Java Collections Framework and with full support for DOM, SAX and JAXP.
http://www.castor.org/ Castor is an Open Source data binding framework for Java. It's the shortest path between Java objects, XML documents and relational tables. Castor provides Java-to-XML binding, Java-to-SQL persistence, and more.
"This is good for quick testing. I always use this. In my case, I have a table, sometimes I care some columns, other times I care some other columns, so I am lazy to remove the last comma when I change columns. It's convenient."
]]>Read source code is a good way to learn anything!http://www.aygfsteel.com/Jcat/archive/2006/08/03/61560.htmlJcatJcatThu, 03 Aug 2006 10:43:00 GMThttp://www.aygfsteel.com/Jcat/archive/2006/08/03/61560.htmlhttp://www.aygfsteel.com/Jcat/comments/61560.htmlhttp://www.aygfsteel.com/Jcat/archive/2006/08/03/61560.html#Feedback0http://www.aygfsteel.com/Jcat/comments/commentRss/61560.htmlhttp://www.aygfsteel.com/Jcat/services/trackbacks/61560.htmlExperience To know how dose List.remove(Object) work, I do many test sample. But I still feel not very realizing. Finally, I took a look at souce code, and then I knew everything!
publicboolean remove(Object o) { if (o ==null) { for (int index =0; index < size; index++) if (elementData[index] ==null) { fastRemove(index); returntrue; } }else{ for (int index =0; index < size; index++) if (o.equals(elementData[index])) { fastRemove(index); returntrue; } } returnfalse; }
1. List store very object's reference but object's own. 2. remove(Object) will remove the first reference in List which refer to the object 3. If you want to change an object to a new index: back up it--> remove it--> re-add it
Experience I create a class to handle something annotated by Annotations. But it doesn't work. I found out it is returned false by Class.getMethod().isAnnotationPresent(Todo.class). Finally, I got the reason by reading source code.
publicenum RetentionPolicy { /** * Annotations are to be discarded by the compiler. */ SOURCE,
/** * Annotations are to be recorded in the class file by the compiler * but need not be retained by the VM at run time. This is the default * behavior. */ CLASS,
/** * Annotations are to be recorded in the class file by the compiler and * retained by the VM at run time, so they may be read reflectively. * * @see java.lang.reflect.AnnotatedElement */ RUNTIME }
?img src="http://www.aygfsteel.com/Emoticons/QQ/god.gif" border="0" height="20" width="20" />Ӟ(x) h的时?1Q抛出ServletException 2QThe page cannot be refreshed without resending the information, Click Retry to send the information again.
?img src="http://www.aygfsteel.com/Emoticons/QQ/god.gif" border="0" height="20" width="20" />Ӟ(x) org.hibernate.MappingException: Could not read mappings from resource: jcat/learn/mapping.xml
]]>Keymap in IntelliJhttp://www.aygfsteel.com/Jcat/archive/2006/06/26/55223.htmlJcatJcatMon, 26 Jun 2006 13:26:00 GMThttp://www.aygfsteel.com/Jcat/archive/2006/06/26/55223.htmlhttp://www.aygfsteel.com/Jcat/comments/55223.htmlhttp://www.aygfsteel.com/Jcat/archive/2006/06/26/55223.html#Feedback0http://www.aygfsteel.com/Jcat/comments/commentRss/55223.htmlhttp://www.aygfsteel.com/Jcat/services/trackbacks/55223.html阅读全文
IntelliLang: IntelliLang is a combination of three basic kinds of functionality that are meant to support the developer in dealing with certain tasks that relate to (custom) languages in IntelliJ IDEA. http://www.jetbrains.net/confluence/display/CONTEST/IntelliLang
HTML Preview: Provides preview for html files using Mozilla browser
==learning==
TabSwitch: Open files/tabs switcher
CVS Report for IntelliJ IDEA: CVS Report for IntelliJ IDEA is a free open source plugin for IntelliJ IDEA to generate statistical reports from your CVS repository. http://vcsreport.sourceforge.net/
]]>Hello Tomcathttp://www.aygfsteel.com/Jcat/archive/2006/06/23/54606.htmlJcatJcatFri, 23 Jun 2006 01:11:00 GMThttp://www.aygfsteel.com/Jcat/archive/2006/06/23/54606.htmlhttp://www.aygfsteel.com/Jcat/comments/54606.htmlhttp://www.aygfsteel.com/Jcat/archive/2006/06/23/54606.html#Feedback0http://www.aygfsteel.com/Jcat/comments/commentRss/54606.htmlhttp://www.aygfsteel.com/Jcat/services/trackbacks/54606.html1. Tomcat config file, where you can change Tomcat's port number: <CATALINA_HOME>/conf/server.xml
note1: whether auto-reload the web application, when .class file is changed 1) during developing, set reloadable=true 2) after deployment, set reloadable=false
2. Some libs
/server/lib
just for Tomcat
/shared/lib
for all web apps
/common/lib
both Tomcat and all web apps
/webapps/jcat/WEB-INF/lib
just present web app
3. Immobile Directory Structure (the names are also immobile, include uppercase/lowercase) /jcat /jcat/WEB-INF /jcat/WEB-INF/web.xml /jcat/WEB-INF/classes /jcat/WEB-INF/lib
Note: WEB-INF/classesis loaded by tomcat before WEB-INF/lib, so classes has priority than lib
*1*
Request in Struts: PageFrom (request.setAttribute by using Form)-->Action(request.getAttribute&setAttribute)-->PageTo (request.getAttribute by using EL)
*2* :
Parameter vs Attribute in request Parameter?/span>
URL带过来的参数Q只能是?/span>
StringQ如www.verican.com/test?para1=1¶2=ttt ?/span>
Action中的调用Q?/span>
request.getParameter("para1"); 在响应页面中的调用:(x)${param.para1}Q?/span>
param?/span>
EL的隐藏对象)
5. Web server跟踪客户状态的四种Ҏ(gu)QHTTP是无状态的协议Q?br /> 1Q徏立含有跟t数据的隐藏表格字段 2Q重写包含额外参数的URL 3Q用持l的Cookie 4Q用Servlet API中的Session机制
6. JavaBean的标?br /> 1) should be a public class 2) should have a non-argument constructor 3) fields should be privated, and using get & set to access them 4) also can have some other functions as a common class
]]>How to use jar to implement double-click-run like .exe filehttp://www.aygfsteel.com/Jcat/archive/2006/06/19/53857.htmlJcatJcatMon, 19 Jun 2006 14:45:00 GMThttp://www.aygfsteel.com/Jcat/archive/2006/06/19/53857.htmlhttp://www.aygfsteel.com/Jcat/comments/53857.htmlhttp://www.aygfsteel.com/Jcat/archive/2006/06/19/53857.html#Feedback2http://www.aygfsteel.com/Jcat/comments/commentRss/53857.htmlhttp://www.aygfsteel.com/Jcat/services/trackbacks/53857.html1. workdir=learnJar
目录l构 + learnJar | mf.mf |+ test | Test.java
2. workdir>javac test\Test.java
+ learnJar | mf.mf |+ test | Test.java | Test.class
3. workdir>jar cvfm a.jar mf.mf test\Test.class
+ learnJar | mf.mf |+ test | Test.java | Test.class |+ a.jar |+ META-INF | MANIFEST.MF |+ test | Test.class