1. Jetspeed2

    refer to: http://portals.apache.org/jetspeed-2/tutorial/01/genapp.html   Setup:   1.  generate two maven submodules: jetexpress-portal and jetexpress-pa.   mvn org.apache.maven.plugins:maven-archetype-plugin:2.0-alpha-4:generate \     -DarchetypeGroupId=org.apache.portals.jetspeed-2 \     -DarchetypeArtifactId=jetspeed-archetype \     -DarchetypeVersion=2.2.0 \     -DartifactId=jetexpress \     -Dpackage=org.apache.portals.tutorials \     -DgroupId=org.apache.portals.tutorials \     -Dversion=1.0-SNAPSHOT   2. change file jetspeed-mvn-settings.xml   2.1 Find the org.apache.jetspeed.server.home configuration parameter and change the path to where you installed Tomcat   2.2 Find the org.apache.jetspeed.production.database.url configuration parameter   3. create file %USERPROFILE%.m2\settings.xml org.apache.portals.jetspeed-2   4. mvn jetspeed:mvn -Dtarget=all     deploy to the tomcat server        access: http://localhost:8080/jetexpress/portal   5. wroking in  Eclipse Env   5.1 mvn eclipse:eclipse   5.2  In Eclipse, go to Window->Preferences->Java->Build Path->Classpath Variables->New and enter the location of your local Maven repository  M2_REPO (typically this is inside a .m2 directory in your user home/profile directory.   5.3 import jetexpress-portal and jetexpress-pa projects   5.4 add portlet in jetexpress-pa project   5.5 deploy to tomcat ENV   mvn jetspeed:mvn -Dtarget=deploy-pa mvn jetspeed:mvn -Dtarget=deploy-portal   access: http://localhost:8080/jetexpress/portal        Create A New Page:    1.  make dir under such as demo       \jetexpress\jetexpress-portal\src\main\webapp\WEB-INF\pages\demo   2. copy and edit folder.metadata & default-page.psml   3.  deploy mvn jetspeed:mvn -Dtarget=deploy-pa mvn jetspeed:mvn -Dtarget=deploy-portal   access: http://localhost:8080/jetexpress/portal  

    2017/02/12 iteye

  2. Web相关

    Tomcat load balance/cluster/fail off   2. SSO based on CAS      tomcat      JBoss portal      SSL   3. Acegi filter / JAAS   4.

    2017/02/12 iteye

  3. AJAX lib 比较

    摘自:http://www.ibm.com/developerworks/cn/web/wa-aj-advjquery/   结论 1:Mootools、jQuery 和 Dojo 在性能方面不分上下。 根据性能进行分类的话,这些库可以分为两组,而不管使用什么浏览器(FF,IE,Chrome)。Mootools、Dojo 和 jQuery 通常属于一个组别,而 Prototype 和 YUI 属于另一个组别,前一组要比后一组快得多。   JavaScript 速度差异的主要原因是每个浏览器都使用自己的 JavaScript 引擎。JavaScript 在这些浏览器中运行得到的时间差很大。jQuery 选择方法在 IE6 上运行比在 Chrome 上运行慢 10 倍。   结论 2:Prototype 和 YUI 的性能很慢   结论 3:浏览器对性能的影响是 JavaScript 库的 9 倍。您可以在特定情况下讨论哪个 JavaScript 库最快,但它最终的影响却是很小的!对于性能而言,浏览器的影响比库本身要大得多。  

    2017/02/12 iteye

  4. liferay笔记

    扩展开发方式       refer to:       1) http://www.liferay.com/web/guest/community/wiki/-/wiki/Main/Development%20Environment%20(Windows);jsessionid=DB374B4B6CDBE3F3211E4538AAB5CFB5       2) http://hi.baidu.com/joelli/blog/item/8205a0ed7103034579f05514.html 这个比较靠谱       主要步骤是: 1.1 安装对应的JDK,Ant,Tomcat。设置环境变量 1.2 下载liferay源文件并导入Eclipse 1.3  添加三个文件覆盖参数             app.server.{your_name}.properties:设置tomcat目录             release.{your_name}.properties: 设置EXT工程目录             build.{your_name}.properties: 设置Build.xml的一些属性              1.4  ant clean start build-ext   1.5 配置mysql         1.5.1 create database lportal       1.5.2  execute script liferay-portal-src-5.2.3\sql\portal-minimal. edit ext-impl/src/portal-ext.properties ## MySQL jdbc.default.driverClassName=com.mysql.jdbc.Driver jdbc.default.url=jdbc:mysql://localhost/lportal?useUnicode=true&characterEncoding=UTF-8&useFastDateParsing=false jdbc.default.username=root jdbc.default.password=     1.6  ant clean deploy        2. lifeRay plugin SDK 开发   2.1 download the plugins SDK from the 'Additional Files' section on the Liferay website. 2.2 This provides ant scripts, to create a simple JSR compliant portlet   ant -Dportlet.name= -Dportlet.display.name="" create    2.3 转化成Eclipse project   ant setup-eclipse  2.4 自己搞定build path问题,这里的jar包都是指向liferay 源文件里面的lib 包。所以本地最好有liferay源文件.   2.5 ant deploy   2.6 liferay 页面可以用这个新添加的portlet了    

    2017/02/12 iteye

  5. Javascript Drag&Drop 小例子

    <!doctype html public "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <title> 代码实例:拖动对象 Drag Object (兼容:IE、Firefox、Opera ... ) <style> .dragAble {position:relative;cursor:move;} <script language="javascript"> function moveMouse(e) { if (isdrag) { oDragObj.style.top = (nn6 ? nTY + e.clientY - y : nTY + event.clientY - y)+"px"; oDragObj.style.left = (nn6 ? nTX + e.clientX - x : nTX + event.clientX - x)+"px"; return false; } } function initDrag(e) { var oDragHandle = nn6 ? e.target : event.srcElement; var topElement = "HTML"; while (oDragHandle.tagName != topElement && oDragHandle.className != "dragAble") { oDragHandle = nn6 ? oDragHandle.parentNode : oDragHandle.parentElement; } if (oDragHandle.className=="dragAble") { isdrag = true; oDragObj = oDragHandle; nTY = parseInt(oDragObj.style.top+0); y = nn6 ? e.clientY : event.clientY; nTX = parseInt(oDragObj.style.left+0); x = nn6 ? e.clientX : event.clientX; document.onmousemove=moveMouse; return false; } } document.onmousedown=initDrag; document.onmouseup=new Function("isdrag=false"); //--> 这些都是可拖动对象 我也可以动吗?     from:  http://blog.csdn.net/xyk0830/archive/2007/11/07/1871712.aspx

    2017/02/12 iteye

  6. hibernate session 管理

    Session per Operation (Anti pattern)   2. Session per Request use "Open Session In View" when rendering layer seperate from servlet, e.g. in JSP   3. Session per Request with detached object when a user case spans several transaction, considering the user think time, we can detach and re-attach the object to different session. Here we mean one session on transaction. For making sure only one user modifying that data, we need to user optimistic lock such as automatic versioning to isolate business use case.   4. Session per Conversation the Hibernate Session can be disconnected from the underlying JDBC connection after the database transaction has been committed and reconnected when a new client request occurs. This pattern is known as session-per-conversation and makes even reattachment unnecessary. Automatic versioning is used to isolate concurrent modifications and the Session will not be allowed to be flushed automatically, but explicitly.

    2017/02/12 iteye

  7. excel 功能

      excel中功能很丰富,掌握了对程序员帮助很大。   基本的有 Filter功能。记得以前给一个老外发excel报表,他说漏掉了一些。我百思不得其解,明明都包括了啊。最后发现是filter功能过滤了,他没有注意到。这是一个题外话。   新公司有个牛人excel应用得很溜。最近学了一招 VLookup, 很好使。   基本上,VLOOKUP作用是 在表格或数值数组的首列查找指定的数值,并由此返回表格或数组当前行中指定列处的数值。 VLOOKUP(lookup_value,table_array,col_index_num,range_lookup) 参数定义如下: 1. Lookup_value    为需要在数组第一列中查找的数值。Lookup_value 可以为数值、引用或文本字符串。 2. Table_array    为需要在其中查找数据的数据表。可以使用对区域或区域名称的引用,例如数据库或列表。 3. Col_index_num    为 table_array 中待返回的匹配值的列序号。Col_index_num 为 1 时,返回 table_array 第一列中的数值;col_index_num 为 2,返回 table_array 第二列中的数值,以此类推。 4. Range_lookup    为一逻辑值,指明函数 VLOOKUP 返回时是精确匹配还是近似匹配。如果为 TRUE 或省略,则返回近似匹配值,也就是说,如果找不到精确匹配值,则返回小于 lookup_value 的最大数值;如果 range_value 为 FALSE,函数 VLOOKUP 将返回精确匹配值。   一个基本用法是: 在excel中我有一列数据Column A, 我需要找哪些在column F中出现了。方法是: 对应column A第一行数据在column B中用函数 =VLookUp(A2, sheet1!$a$2:$f$100, 1, false). 这样在Column B中非Null中都是匹配上的,通过filter功能可以过滤出来。   其他还有 =UPPer(A2)              =Lower(A2)   关键有两个地方: 1. 应用函数需要 = 才能生效 2. 上面函数只是对一列中的一行数据生效了,对整列生效,需要选中已生效的那个Cell(A12)按住鼠标往下拖,该列所有行都会生效的。  

    2017/02/12 iteye

  8. 测试工具

    测试工具

    2017/02/11 iteye test