fossil

          鳥(niǎo)在籠中,恨關(guān)羽不能張飛 人處世上,要八戒更須悟空
          posts - 40, comments - 0, trackbacks - 0, articles - 0
            BlogJava :: 首頁(yè) :: 新隨筆 :: 聯(lián)系 :: 聚合  :: 管理

          2007年10月17日

               摘要:   閱讀全文


          文章來(lái)源:http://www.aygfsteel.com/beansoft/archive/2007/11/03/157955.html

          posted @ 2007-11-30 20:57 J2EE UP UP 閱讀(193) | 評(píng)論 (0)編輯 收藏

          BeanSoft 的 AJAX 視頻, 電子書(shū)集中下載

          陸續(xù)上傳中, 請(qǐng)關(guān)注:

          http://cid-519b3f7aa2172030.skydrive.live.com/browse.aspx/Public/AJAX




          文章來(lái)源:http://www.aygfsteel.com/beansoft/archive/2007/11/05/158174.html

          posted @ 2007-11-30 20:57 J2EE UP UP 閱讀(186) | 評(píng)論 (0)編輯 收藏

          用戶 A 寫道:
          我從實(shí)用的角度上來(lái)說(shuō) **** 框架/技術(shù)是相當(dāng)爛的一個(gè)東西.
          從理論上也許先進(jìn).

          用戶 B 反駁道:
          我不喜歡聽(tīng)沒(méi)有證據(jù)的東西。不知道你指的"**** 是相當(dāng)爛的一個(gè)東西"什么意思?不知道你使用****有多久?是做了具體的項(xiàng)目體會(huì)出來(lái)它很爛還是玩了半天就覺(jué)得它爛?能不能舉出具體的例子?
          我認(rèn)為 **** 很棒,因?yàn)檫@是我在做項(xiàng)目和學(xué)習(xí)的過(guò)程中體會(huì)到的。
          國(guó)外有很多牛人都認(rèn)為 ****很棒,牛人 XXX 從????年就已經(jīng)在他的項(xiàng)目中使用了自己的****架構(gòu),至今有很多大型的項(xiàng)目都在使用這個(gè)****架構(gòu)。**** 在此之上做了很多的改進(jìn),總結(jié)了框架 A 和框架 B 的不足,是經(jīng)過(guò)很多考驗(yàn)和實(shí)踐總結(jié)的成果,希望大家不要只花了半天時(shí)間就把它否定掉。

           

          把 **** 替換成不同的框架/技術(shù), 這就是當(dāng)前技術(shù)推廣貼的一貫文風(fēng).




          文章來(lái)源:http://www.aygfsteel.com/beansoft/archive/2007/11/05/158295.html

          posted @ 2007-11-30 20:57 J2EE UP UP 閱讀(195) | 評(píng)論 (0)編輯 收藏

          http://cid-519b3f7aa2172030.skydrive.live.com/browse.aspx/Public/MyEclipse中文文檔

          ?

          現(xiàn)在放上去的有 JSF 和 Hibernate 的.

          目前正在翻譯帶有 Flash 操作動(dòng)畫(huà)的 Spring + Hibernate. 感謝關(guān)注.

          翻譯結(jié)束后將根據(jù)文檔制作視頻教程.




          文章來(lái)源:http://www.aygfsteel.com/beansoft/archive/2007/11/06/158487.html

          posted @ 2007-11-30 20:57 J2EE UP UP 閱讀(251) | 評(píng)論 (0)編輯 收藏

          Welcome to the home of the Spring Framework, the leading full-stack Java/JEE application framework. Led and sustained by Interface21, Spring delivers significant benefits for many projects, increasing development productivity and runtime performance while improving test coverage and application quality.

          Article: Introduction to the Spring Framework 2.5

          Technical Article

          In this TSS article, Rod Johnson explains what Spring sets out to achieve and how it can help the community develop enterprise Java applications.

          Spring Framework Training Summary (November)

          News and Announcements
          Interface21 is pleased to offer a number of Spring Framework 2.0 and AOP training events in the upcoming period, delivered by the people who build and sustain the Spring Framework. For full details, please visit the main training information page. Here is a summary of some of the upcoming courses and venues:

          ... plus others

          Interested in a full-course of Spring during Winter? The Spring Experience 2007 conference is taking place in sunny Hollywood, Florida, from Dec. 12th-15th.

          今天去 http://www.springframework.org/ 看了一眼, 很不幸的首頁(yè)充斥了培訓(xùn)信息, 還有在中國(guó)的...

          其實(shí) Spring 的法律上的版權(quán)所有者: Interface21 公司, 是有他們自己的網(wǎng)站的. 不過(guò), 開(kāi)源軟件不等于放棄版權(quán), 這個(gè)大家一定要清楚啊. 讓一個(gè) .org 的網(wǎng)站充滿了這樣的信息, 真是一種悲哀. 錢, 錢, 錢....




          文章來(lái)源:http://www.aygfsteel.com/beansoft/archive/2007/11/06/158490.html

          posted @ 2007-11-30 20:57 J2EE UP UP 閱讀(168) | 評(píng)論 (0)編輯 收藏

               摘要: MyEclipse 自帶的 Hibernate 和 Spring 教程(含視頻)翻譯, 內(nèi)容包括: 簡(jiǎn)介 建議的聽(tīng)眾 系統(tǒng)需求 開(kāi)始工作 反向工程 編寫和運(yùn)行 Hibernate 整合 Spring 代碼 小結(jié) 常見(jiàn)問(wèn)題 FAQ 資源 反饋
            閱讀全文


          文章來(lái)源:http://www.aygfsteel.com/beansoft/archive/2007/11/07/158875.html

          posted @ 2007-11-30 20:57 J2EE UP UP 閱讀(212) | 評(píng)論 (0)編輯 收藏

          原創(chuàng)講解JSP過(guò)濾器和監(jiān)聽(tīng)器

          BeanSoft(劉長(zhǎng)炯) 2007年11月

          關(guān)于這個(gè)問(wèn)題, 比較復(fù)雜的說(shuō). 不過(guò)我希望通過(guò)例子來(lái)解釋會(huì)方便理解一些.

          假設(shè)有一個(gè)非常危險(xiǎn)的任務(wù), 是九死一生. 需要你揣著炸藥包從北平開(kāi)車走高速路過(guò)保定去石家莊把鬼子的碉堡給炸了. 注意: 這個(gè)任務(wù)十分艱巨, 有可能半路炸藥爆炸. 所以出發(fā)前你需要苦練10元一本的<<鐵布衫>>, 還需要立遺囑交代一下后事. 下面是路線圖:
          去時(shí)路線: 北平 ==> 高速路收費(fèi)站入口(都有警察和警犬) A? ==> 保定收費(fèi)站 B ==> 石家莊收費(fèi)站 C ==> 炸碉堡 D ==> 轉(zhuǎn)車(剛才的車已經(jīng)炸沒(méi)了) E =>
          回來(lái)路線: 石家莊收費(fèi)站 ==> 保定收費(fèi)站 ==> 高速路收費(fèi)站出口(都有警察和警犬) A ==> 安全回到北平 G

          那么我們先簡(jiǎn)介可能發(fā)生的情況.? A 點(diǎn)有可能被警察和警犬發(fā)現(xiàn), 所以你只能被扭送回北平.? 即使不被發(fā)現(xiàn), 還可能出現(xiàn)收費(fèi)時(shí)發(fā)現(xiàn)10個(gè)現(xiàn)大洋一個(gè)路口的買路錢沒(méi)帶!! 哎, 只能又回去了. 還有最慘的: 高速路入口寫著: 對(duì)不起, 到石家莊的路線因?yàn)槭┕げ煌? 只好回家等著吧.
          到了B和C你可能還會(huì)被人發(fā)現(xiàn)帶了炸藥包, 或者發(fā)現(xiàn)買路費(fèi)少帶了! 極有可能又被扭送回北平, 注意已經(jīng)在半道了, 是不會(huì)讓你繼續(xù)到石家莊的, 所以你會(huì)被從車上逮下來(lái), 然后轉(zhuǎn)到警車上帶回來(lái)!? 也就是從 B 或者 C 直接返回.
          好了, 最佳情況就是你炸了碉堡, 也成功的返回了. 然后你可以開(kāi)心的把<<鐵布衫>>扔了, 然后宣告遺囑作廢.

          OK, 以上過(guò)程, 就是過(guò)濾器和監(jiān)聽(tīng)器的真實(shí)案例.

          那么炸碉堡這個(gè)任務(wù), 就相當(dāng)于要調(diào)用 JSP 或者 Servlet 來(lái)獲得執(zhí)行結(jié)果(炸碉堡 D ).? 在執(zhí)行之前你需要做一些準(zhǔn)備工作, 相當(dāng)于要寫一個(gè)
          監(jiān)聽(tīng)器 com.allanlxf.ums.web.ServiceListener
          在里面你可以做一些事情例如初始化資源, 例如上文的苦練<<鐵布衫>>, 立遺囑, 這個(gè)相當(dāng)于代碼中的
          public void contextInitialized(ServletContextEvent sce) 這樣一個(gè)初始化事件.
          那么在整個(gè)任務(wù)完成之后, 這些事情你就要考慮應(yīng)該作廢了, 所以需要
          public void contextDestroyed(ServletContextEvent sce) 這樣一個(gè)銷毀事件, 例如把<<鐵布衫>>扔了, 然后宣告遺囑作廢, 也就是收回資源.

          那么過(guò)濾器在哪里呢? 它位于任務(wù)的 A B C 點(diǎn). 注意是雙向路程都會(huì)經(jīng)過(guò)的. 也就是請(qǐng)求和響應(yīng)都會(huì)經(jīng)過(guò). 但是過(guò)濾器也會(huì)檢查不同的情況, 例如 A 點(diǎn)實(shí)際上有兩個(gè)過(guò)濾功能: 查炸藥包和收買路錢. 這就相當(dāng)于配置了:
          ??
          ?????? sessionFilter
          ???? * *.do
          ???? * REQUEST
          ???? * FORWARD
          ??
          ?
          兩個(gè)過(guò)濾功能都要檢查. 如果成功了怎么辦呢? 會(huì)繼續(xù)讓你走下一個(gè)路口, 注意不是讓你直接成功. 也就是代碼:
          ??????? if(session.getAttribute("user") != null || path.equals("/login"))//若用戶已經(jīng)登錄并且當(dāng)前路徑仍然停留在登錄頁(yè)面????? {???????????
          ?????????? chain.doFilter(request, response);//繼續(xù)走下面的過(guò)濾器或者任務(wù)(不保證最終任務(wù), 因?yàn)橄聜€(gè)過(guò)濾器也可能讓你回來(lái))
          ?????????? 只有當(dāng)走到 C 點(diǎn)的時(shí)候, 下一步才是執(zhí)行了最終的任務(wù): 執(zhí)行JSP或者Servlet.
          ?????? }
          反過(guò)來(lái)怎么辦? 把你扭送上警車, 強(qiáng)行返回! 這樣你連路口 B C 和最終任務(wù)都無(wú)法訪問(wèn)了. 也就是不會(huì)讓你訪問(wèn)下一個(gè)過(guò)濾器和執(zhí)行最終的 JSP 或者 Serlvet, 可以選擇直接返回, 或者放警車上帶回去.
          ?????? {
          ?????????? return;// 直接返回
          ?????????? 或者 response.sendRedirect(request.getContextPath() + "/login.jsp");//則扭送上警車, 強(qiáng)行返回到警察局
          ?????? }

          那么在 E 點(diǎn)發(fā)生了什么? 也就是你可能替換掉了原來(lái)的 response 對(duì)象,? 也就是換車. 這意味著你可以在過(guò)濾器里私下修改請(qǐng)求和響應(yīng)對(duì)象.

          雖然已經(jīng)不那么抽象了, 但是要理解可能還是需要耐心體會(huì)的.

          =====================================================================
          注: 原始問(wèn)題

          ??? 1.請(qǐng)看下面一段代碼和其注釋:
          import javax.servlet.*;

          import javax.servlet.http.*;

          import java.io.*;

          public class SessionFilter extends HttpFilter

          {

          ?? public void doFilter(HttpServletRequest request, HttpServletResponse response, FilterChain chain)

          ?????????????? throws ServletException, IOException

          ?? {

          ?????? String path = request.getServletPath();//取得該servlet的路徑名稱

          ?????? path = path.substring(0, path.indexOf("."));?? //獲得路徑中.之前的部分

          ?????? HttpSession session = request.getSession();//從請(qǐng)求中取得session為得是從session中讀取用戶是否登錄的標(biāo)志值

          ?????? if(session.getAttribute("user") != null || path.equals("/login"))//若用戶已經(jīng)登錄并且當(dāng)前路徑仍然停留在登錄頁(yè)面

          ?????? {???????????

          ???????? *? chain.doFilter(request, response);//則將當(dāng)前濾鏡加入到濾鏡鏈條當(dāng)中

          ?????? }else//若用戶尚未成功登錄

          ?????? {

          ?????????? response.sendRedirect(request.getContextPath() + "/login.jsp");//則使用請(qǐng)求重定向轉(zhuǎn)到登錄頁(yè)面

          ?????? }???????

          ?? }

          }

          /*

          * 該Filter濾鏡類所過(guò)濾的是用戶在瀏覽器中輸入的

          * 當(dāng)前web application的訪問(wèn)路徑,通過(guò)判斷用戶是

          * 否成功登錄而決定是否對(duì)訪問(wèn)路徑加以限止

          * 在該web application的web.xml配置文件中為

          * 該filte濾鏡做了相應(yīng)配置

          */

          請(qǐng)問(wèn): 上面代碼FilterChain對(duì)象盛裝的是Filter對(duì)象, 可它是怎么工作的啊?
          加*號(hào)的語(yǔ)句是何用意啊,不是過(guò)濾路徑嗎, 為什么要將請(qǐng)求與響應(yīng)加入呢?

          2.請(qǐng)看下面一段代碼:

          import javax.servlet.*;

          import javax.servlet.http.*;

          import java.io.*;

          public abstract class HttpFilter implements Filter

          {

          ?? private FilterConfig config;

          ?? public void init(FilterConfig config) throws ServletException

          ?? {

          ?????? this.config = config;

          ?????? init();

          ?? }

          ?? public void init() throws ServletException

          ?? {

          ?? }

          ?? public String getInitParameter(String name)

          ?? {

          ?????? return config.getInitParameter(name);

          ?? }

          ?? public ServletContext getServletContext()

          ?? {

          ?????? return config.getServletContext();

          ?? }

          ?? public final void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)

          ?????????????? throws ServletException, IOException

          ?? {

          ?????? doFilter((HttpServletRequest)request, (HttpServletResponse)response, chain);

          ?? }

          ?? public abstract void doFilter(HttpServletRequest request, HttpServletResponse response, FilterChain chain)

          ?????????????? throws ServletException, IOException;

          ?? public void destroy()

          ?? {

          ?? }

          }

          請(qǐng)問(wèn): 該類就這樣寫了一下,沒(méi)有包含任何行為,它如何完成過(guò)濾工作啊?

          3.請(qǐng)看下面代碼:
          package com.allanlxf.ums.web;

          import javax.servlet.*;

          //import javax.servlet.http.*;

          import com.allanlxf.ums.service.SystemService;

          import com.allanlxf.ums.service.StudentService;

          public class ServiceListener implements ServletContextListener

          {

          ?? public void contextInitialized(ServletContextEvent sce)

          ?? {

          ?????? ServletContext application = sce.getServletContext();

          ?????? StudentService service = new StudentService();

          ?????? application.setAttribute("studentService", service);

          ?????? SystemService systemService = new SystemService();

          ?????? application.setAttribute("systemService", systemService);

          ?? }

          ?? public void contextDestroyed(ServletContextEvent sce)

          ?? {

          ?? }

          }

          /*

          *本類是該web application的監(jiān)聽(tīng)器類,在該類中,

          *將兩個(gè)無(wú)為本系統(tǒng)提供服務(wù)的兩個(gè)對(duì)象寫入到了

          *application隱含對(duì)象中(這樣保證在該系統(tǒng)的任何

          *地方都能夠取得這兩個(gè)服務(wù)類對(duì)象的引用)

          *在本系統(tǒng)的web.xml文件中對(duì)該監(jiān)聽(tīng)器做了配置

          */

          請(qǐng)問(wèn): 為什么要將服務(wù)類對(duì)象寫入到程序上下文中呢,直接創(chuàng)建不也一樣嗎?
          ???? 監(jiān)聽(tīng)器只有這樣的功能嗎,是否還有其它功能呢?

          3.請(qǐng)看下面的配置文件內(nèi)容:

          ??
          ?????? sessionFilter
          ?????? com.allanlxf.ums.web.SessionFilter
          ??
          ???
          ??
          ?????? sessionFilter
          ???? * *.do
          ???? * REQUEST
          ???? * FORWARD
          ??
          ???????
          ??
          ?????? com.allanlxf.ums.web.ServiceListener
          ???

          請(qǐng)問(wèn): 加*號(hào)的三項(xiàng)是什么意思?

          當(dāng)初老師講的時(shí)候,許多基本的原則原理尚不清楚,這些根本沒(méi)有聽(tīng)明白,當(dāng)然,老師也未細(xì)講,只說(shuō)會(huì)用即可, 可是若不能明白其本質(zhì),用也只能用這一點(diǎn)兒, 怎么成呢, 希望您能夠比較詳悉的講一下. thank you very much!




          文章來(lái)源:http://www.aygfsteel.com/beansoft/archive/2007/11/09/159374.html

          posted @ 2007-11-30 20:57 J2EE UP UP 閱讀(273) | 評(píng)論 (0)編輯 收藏

          這是 MyEclipse 幫助文檔中的內(nèi)容的翻譯, 點(diǎn)擊菜單 Help -> Contents 可以看到 MyEclipse 的全部英文幫助文檔.

          在線閱讀(完整內(nèi)容含 Flash 動(dòng)畫(huà)): http://beansoft.java-cn.org/myeclipse_doc_cn/hibernateintroduction/

          下載: http://cid-519b3f7aa2172030.skydrive.live.com/self.aspx/Public/MyEclipse中文文檔/MyEclipseHibernate入門視頻中文版.zip 4.07 MB 

          友情提示: 下載微軟網(wǎng)盤文件時(shí)關(guān)閉下載工具,  否則你將得到錯(cuò)誤的文件, 雙擊 EXE 會(huì)出來(lái) DOS 窗口. 正確操作是點(diǎn)擊文件名后能看到顯示下載鏈接和文件大小等信息.

          MyEclipse Logo

          MyEclipse Hibernate 入門教程中文版(含視頻)
          翻譯: 劉長(zhǎng)炯 BeanSoft@126.com
          Blog: http://www.aygfsteel.com/beansoft/
          日期: 2007-11-13
          聲明: 中文文字版權(quán)歸 劉長(zhǎng)炯 所有, 原文及相關(guān)的圖片等資源的版權(quán)歸原作者 Genuitec L.L.C 公司所有.

          目錄

          1. 簡(jiǎn)介
          2. 建議的聽(tīng)眾
          3. 系統(tǒng)需求
          4. Hibernate 介紹
          5. 開(kāi)始工作
          6. 反向工程
          7. 編寫和運(yùn)行 Hibernate 代碼
          8. 小結(jié)
          9. 常見(jiàn)問(wèn)題
          10. 資源
          11. 反饋
           
           

          本人原創(chuàng) MyEclipse 6 幫助文檔中文版集中下載

          http://cid-519b3f7aa2172030.skydrive.live.com/browse.aspx/Public/MyEclipse中文文檔

           
           
           
           
           
           
           
           



          文章來(lái)源:http://www.aygfsteel.com/beansoft/archive/2007/11/13/160288.html

          posted @ 2007-11-30 20:57 J2EE UP UP 閱讀(371) | 評(píng)論 (0)編輯 收藏

          這是 MyEclipse 幫助文檔中的內(nèi)容的翻譯, 點(diǎn)擊菜單 Help -> Contents 可以看到 MyEclipse 的全部英文幫助文檔.

           

          下載: http://beansoft.java-cn.org/myeclipse_doc_cn/MyEclipse_Struts_1.x_Tutorial_zh_CN.pdf  597 KB

           

          目錄

          1. 前言
          2. 簡(jiǎn)介
          3. 系統(tǒng)需求
          4. 設(shè)置新項(xiàng)目和目錄結(jié)構(gòu)
          5. 開(kāi)始 Struts 項(xiàng)目
            1. Struts 項(xiàng)目的組成部分
            2. 構(gòu)造我們的應(yīng)用
          6. 運(yùn)行示例代碼
          7. 小結(jié)
          8. 用戶反饋

           

          頁(yè)面顯示效果:

          MyEclipse Struts 1.x Tutorial




          文章來(lái)源:http://www.aygfsteel.com/beansoft/archive/2007/11/16/160876.html

          posted @ 2007-11-30 20:57 J2EE UP UP 閱讀(430) | 評(píng)論 (0)編輯 收藏

          MyEclipse 6 實(shí)戰(zhàn)開(kāi)發(fā)講解視頻入門 6 Web 入門開(kāi)發(fā) - JSP/HTML/JDBC 登錄

          本視頻介紹了開(kāi)發(fā)中最難而又最容易被輕視的部分: JSP, 部分是因?yàn)楹芏嗳诉^(guò)分夸大了 Web 層框架例如 Struts 1 or 2, Spring MVC, JSF, Wichet 等等的作用(事實(shí)上對(duì)于編寫復(fù)雜的頁(yè)面, 這些框架都沒(méi)多大幫助). JSP 是表現(xiàn)層, 實(shí)際上不是那么容易做好的, 因?yàn)樗C合了 Web 層的幾乎所有技術(shù), 包括但不限于 DHTML, JavaScript, CSS, AJAX, 緩存等.

          友情提示: 下載微軟網(wǎng)盤文件時(shí)關(guān)閉下載工具,  否則你將得到錯(cuò)誤的文件, 雙擊 EXE 會(huì)出來(lái) DOS 窗口. 正確操作是點(diǎn)擊文件名后能看到顯示下載鏈接和文件大小等信息.

          代碼: http://cid-519b3f7aa2172030.skydrive.live.com/self.aspx/Public/MyEclipse6Videos/6_JSPHelloWorld.zip 445KB

          視頻(第一部分):  http://cid-519b3f7aa2172030.skydrive.live.com/self.aspx/Public/MyEclipse6Videos/MyEclipse6_6_1.exe 22分05秒 8.20MB

          視頻(第二部分):  http://cid-519b3f7aa2172030.skydrive.live.com/self.aspx/Public/MyEclipse6Videos/MyEclipse6_6_2.exe 40分26秒 10.5 MB

          1. 新建 Web 項(xiàng)目
          2. 編寫首頁(yè),登錄提交表單頁(yè)面并加入客戶端表單驗(yàn)證 JavaScript, 超鏈接CSS
          3. 編寫后臺(tái) Java 類 - 業(yè)務(wù)層(Biz Layer)和數(shù)據(jù)層(DAO)
          4. 編寫 JSP, 加入必要的驗(yàn)證并調(diào)用后臺(tái)業(yè)務(wù)類
          5. 測(cè)試運(yùn)行, 驗(yàn)證登錄和退出
          6. SQL 注入: 用戶輸入名字為 user' or '1' = '1 拼出的攻擊SQL為:
              select * from myuser where user = 'user' or '1' = '1' and password = 'abc'

          視頻截圖:

          image

          image




          文章來(lái)源:http://www.aygfsteel.com/beansoft/archive/2007/11/19/161502.html

          posted @ 2007-11-30 20:57 J2EE UP UP 閱讀(599) | 評(píng)論 (0)編輯 收藏

          因?yàn)楸卷?xiàng)目已經(jīng)停止更新, 僅提供代碼供參考, 本人保持版權(quán), 不提供任何擔(dān)保和技術(shù)支持.

          附帶用戶貢獻(xiàn)排行, 頁(yè)面點(diǎn)擊率等多個(gè)插件.


          Eclipse 項(xiàng)目文件(兩個(gè)都在才能編譯運(yùn)行)
          JSPWiki 項(xiàng)目改進(jìn)版 http://beansoft.java-cn.org/download/JSPWiki2.4.71_project_src.7z  5.91 MB
          插件及中文模版增強(qiáng)文件 http://beansoft.java-cn.org/download/JSPWikiPlugins_project_src.7z  3.11 MB
          下載, 導(dǎo)入, 編譯及數(shù)據(jù)庫(kù)配置, 運(yùn)行視頻(無(wú)聲)
          http://beansoft.java-cn.org/download/jspwiki_beansoft.exe 3.0 MB

          環(huán)境: JDK 1.5, Eclipse 3.3, Tomcat 6.0.14, Mysql 5.0, Windows XP
          圖解發(fā)布過(guò)程
          真實(shí)操作以視頻為準(zhǔn).

          JSPWiki




          文章來(lái)源:http://www.aygfsteel.com/beansoft/archive/2007/11/20/161836.html

          posted @ 2007-11-30 20:57 J2EE UP UP 閱讀(220) | 評(píng)論 (0)編輯 收藏

          今天首頁(yè)看到一篇文章, 說(shuō)了國(guó)人詆毀嫦娥一號(hào)的事. 也沒(méi)什么好說(shuō)的, 怨天尤人是不對(duì). 然后在上面點(diǎn), 就看到了另外的一篇新聞:

          奴隸般勞動(dòng),日本工會(huì)幫中國(guó)女工維權(quán) http://news.qq.com/a/20071122/001583.htm 

          也許大家的忘性很大, 已經(jīng)忘記了黑窯廠等等, 忘了北京方圓百里就是沒(méi)有任何現(xiàn)代氣息的城鄉(xiāng)結(jié)合部, 忘了苦苦掙扎在老家的農(nóng)村的鄉(xiāng)親們, 忘了在溫州, 深圳打工的人.  當(dāng)然, 我也是打工一員, 吃飽是沒(méi)問(wèn)題, 可是也就僅此而已.  聰明人很多, 但是多數(shù)人卻很窮, 是大家不努力工作嘛? 不是. 那是什么呢?

           

          這篇文章中日本工會(huì)的組織者說(shuō)的一段話發(fā)人深思:

          “她們都是善良而誠(chéng)實(shí)的勞動(dòng)者,為了家族的責(zé)任,來(lái)到日本,決心努力勞動(dòng)3年,卻在這里遭受了奴隸般的勞動(dòng)生活,這是不公正的。構(gòu)成社會(huì)的大部分成員都是普通勞動(dòng)者,她們的權(quán)利和生活得不到保障的話,還談什么‘發(fā)展’?財(cái)富集中在一小部分人身上的時(shí)候,談‘發(fā)展’就是一種欺騙。

          2007年11月4日,日本廣島東部福山市的工會(huì)領(lǐng)袖武藤貢回復(fù)了這樣一封郵件給記者。半年多前,在他的幫助下,3名中國(guó)女工李紅慧、沈曉梅、繆秀琴與她們的日本雇主展開(kāi)了長(zhǎng)達(dá)一個(gè)多月的激烈斗爭(zhēng),并成功拿回了自己應(yīng)得的400多萬(wàn)日元,回到她們位于蘇北農(nóng)村的故鄉(xiāng)。.....

           

          再摘一段人民網(wǎng)貼的內(nèi)容: 書(shū)摘:1949年以后的蔣經(jīng)國(guó)與臺(tái)灣 http://www.people.com.cn/GB/wenhua/1086/2078201.html

          最近十年在臺(tái)灣任何一個(gè)有關(guān)"誰(shuí)對(duì)臺(tái)灣貢獻(xiàn)最大"的民意調(diào)查里,蔣經(jīng)國(guó)始終穩(wěn)居首位。1960年代,臺(tái)灣經(jīng)濟(jì)穩(wěn)定累積成長(zhǎng),在有力的政治與社會(huì)條件中,技術(shù)官僚得以發(fā)揮最大的才干,加上國(guó)際資本和技術(shù)幾次轉(zhuǎn)移,臺(tái)灣成為有效率的接納者。到了1960年代末期,赤貧人口大幅降低,許多臺(tái)灣大學(xué)生畢業(yè)后就往美國(guó)跑,人民的生活已達(dá)小康的水平,唱歌、跳舞、打保齡球的娛樂(lè)活動(dòng)如雨后春筍。如果說(shuō)美國(guó)人努力影響蔣經(jīng)國(guó)的看法,他們顯然沒(méi)有白費(fèi)功夫,蔣經(jīng)國(guó)幾次訪問(wèn)美國(guó),眼見(jiàn)美國(guó)生產(chǎn)力的強(qiáng)大,印象十分深刻。美國(guó)式的管理不是從上而下的教育和指令,而是法治文化中的契約精神,在這種遵守公共約定的自覺(jué)中,人人追求創(chuàng)新,力爭(zhēng)上游。這種現(xiàn)象對(duì)于一向習(xí)慣于蘇聯(lián)式思辨的蔣經(jīng)國(guó)而言,確實(shí)耳目一新。此外,最具說(shuō)服力的仍然是發(fā)展的事實(shí)本身,在美國(guó)受教育的知識(shí)菁英開(kāi)始發(fā)揮影響力,他們根據(jù)所學(xué)結(jié)合臺(tái)灣的情形所制定的發(fā)展方案,確實(shí)行之有效,使得人民生活大幅改善,社會(huì)財(cái)富累積迅速。這樣的成果使得任何人都不得不重視美式管理背后的思維邏輯,一開(kāi)始是經(jīng)濟(jì)的,接著便是政治的。 

           

          全中國(guó)的人民, 向60年代的臺(tái)灣邁進(jìn)吧! 我最希望的就是家鄉(xiāng)能早日出現(xiàn) IT 業(yè), 這樣我就不用背井離鄉(xiāng)了, 呵呵.




          文章來(lái)源:http://www.aygfsteel.com/beansoft/archive/2007/11/22/162489.html

          posted @ 2007-11-30 20:57 J2EE UP UP 閱讀(221) | 評(píng)論 (0)編輯 收藏

          這是 MyEclipse 幫助文檔中的內(nèi)容的翻譯, 點(diǎn)擊菜單 Help -> Contents 可以看到 MyEclipse 的全部英文幫助文檔.

          在線閱讀(完整內(nèi)容含 Flash 動(dòng)畫(huà)): http://beansoft.java-cn.org/myeclipse_doc_cn/ajaxtutorial/

          下載: http://cid-519b3f7aa2172030.skydrive.live.com/self.aspx/Public/MyEclipse中文文檔/ajaxtutorial.zip 1.53 MB 

          友情提示: 下載微軟網(wǎng)盤文件時(shí)關(guān)閉下載工具,  否則你將得到錯(cuò)誤的文件, 雙擊 EXE 會(huì)出來(lái) DOS 窗口. 正確操作是點(diǎn)擊文件名后能看到顯示下載鏈接和文件大小等信息.

          翻譯: 劉長(zhǎng)炯 BeanSoft@126.com
          Blog: http://www.aygfsteel.com/beansoft/
          日期: 2007-11-22
          聲明: 中文文字版權(quán)歸 劉長(zhǎng)炯 所有, 原文及相關(guān)的圖片等資源的版權(quán)歸原作者 Genuitec L.L.C 公司所有.

          目錄

          1. 簡(jiǎn)介
          2. 建議的聽(tīng)眾
          3. 系統(tǒng)需求
          4. AJAX Debugging
          5. 小結(jié)
          6. 常見(jiàn)問(wèn)題 FAQ
          7. 資源
          8. 反饋

           

          本人原創(chuàng) MyEclipse 6 幫助文檔中文版集中下載

          http://cid-519b3f7aa2172030.skydrive.live.com/browse.aspx/Public/MyEclipse中文文檔




          文章來(lái)源:http://www.aygfsteel.com/beansoft/archive/2007/11/22/162498.html

          posted @ 2007-11-30 20:57 J2EE UP UP 閱讀(440) | 評(píng)論 (0)編輯 收藏

          近日看到各大中文網(wǎng)站紛紛嗆聲說(shuō) Spring 2.5 發(fā)布, 典型消息如下:

           

          來(lái)自 Springframework 官方的消息,Spring 2.5 正式發(fā)布了。

          http://www.springframework.org/node/561

          該版本的主要特征包括:
          對(duì)Spring2.0的平滑升級(jí) —— Spring2.5被設(shè)計(jì)成為對(duì)Spring2.0的平滑升級(jí),現(xiàn)存的代碼和配置文件不需要做任何更改。
          更多XML命名空間配置 —— 新的命名空間包括和
          完全支持Java 6和Java EE 5 —— Spring2.5支持Java 6和Java EE 5的所有新特性——同時(shí)也提供了對(duì)Java 1.4.2和J2EE1.3的支持。
          完全支持基于注解的配置 —— 現(xiàn)在所有的配置都可以使用注解來(lái)實(shí)現(xiàn),并且也支持 JSR250 注解。
          基于注解的MVC controller —— Web Controller現(xiàn)在可以用如@RequestMapping這樣的注解來(lái)創(chuàng)建,無(wú)需實(shí)現(xiàn)任何接口。
          對(duì)AspectJ的支持 —— 在一些環(huán)境下,增加了對(duì)AspectJ的裝載時(shí)編織支持,同時(shí)提供了一個(gè)新的bean切入點(diǎn)。
          對(duì)OSGi的支持 —— Spring2.5框架的所有jar包都是兼容于OSGi的,以此來(lái)簡(jiǎn)化在OSGi環(huán)境下對(duì)其的使用。
          測(cè)試框架的巨大改變 —— 現(xiàn)在新的基于注解的測(cè)試框架已經(jīng)支持TestNG和JUnit4
          性能的改良 —— Spring2.5各方面的性能指標(biāo)都有了顯著的改善。

          沖著 完全支持基于注解的配置 這句話, 我興沖沖的下載了 Spring 2.5 以及其文檔, 企圖體驗(yàn)一下 EJB 3 式的簡(jiǎn)單快速的基于標(biāo)注的開(kāi)發(fā), 然而, 遺憾的是官方文檔和消息的來(lái)源頁(yè)面: http://www.springframework.org/node/561, 沒(méi)有任何文字說(shuō)到自己完全支持基于注解的配置. 我打開(kāi)英文的 Reference, 仔細(xì)閱讀其中關(guān)于標(biāo)注的部分, 然而遺憾的發(fā)現(xiàn)只是部分實(shí)現(xiàn)了標(biāo)注, 請(qǐng)參考 http://static.springframework.org/spring/docs/2.5.x/reference/beans.html#beans-annotation-config , 簡(jiǎn)單說(shuō)就是實(shí)現(xiàn)了對(duì) Autowired 和 Transaction, AOP 的標(biāo)注支持, 而不是所有 bean 定義, 更不是說(shuō)從此你可以不用寫 Bean 配置的 XML 文件了. 下午仔細(xì)試了半天, 企圖寫出標(biāo)注配置的例子來(lái), 也沒(méi)有成功實(shí)現(xiàn)不寫 bean 定義 XML 文件就能初始化 Bean 并注入所有屬性的功能(本來(lái)想做的例子是注入一個(gè) message 的 String 屬性), 去閱讀下載的示例代碼(example目錄下的文件), 也沒(méi)有這樣的例子. 最后又發(fā)現(xiàn)了原來(lái)支持標(biāo)注的版本在這里:

          http://www.jroller.com/habuma/entry/guice_vs_spring_javaconfig_a

          它的名字叫 Spring JavaConfig.

          最后我們?cè)賮?lái)看看原始頁(yè)面是如何介紹自己的標(biāo)注的(http://www.springframework.org/node/561):

          Spring 2.5 enhances Spring 2.0 with many exciting new features, including:
          Full Java 6 and Java EE 5 support (JDBC 4.0, JTA 1.1, JavaMail 1.4, JAX-WS 2.0)
          Full-featured annotation-driven dependency injection, including support for 'qualifiers' (注意這里只是說(shuō)完整支持標(biāo)注驅(qū)動(dòng)的依賴注入, 而不是 complete supported annotation of all features)
          Support for auto-detecting application components in the classpath and auto-configuring them as Spring managed objects
          A new bean name pointcut element in AspectJ pointcut expressions
          Built-in support for AspectJ load-time weaving based on the LoadTimeWeaver abstraction
          New XML configuration namespaces "context" and "jms", for maximum convenience
          A completely revised integration test framework, with first-class support for JUnit 4 and TestNG
          A new annotation-based controller model for Spring MVC supporting Servlet and Portlet environments
          Extended SimpleJdbcTemplate functionality, including support for named SQL parameters
          Officially certified WebSphere support
          The packaging of Spring Framework jars as OSGi-compliant bundles out of the box
          The ability to deploy a Spring ApplicationContext as a JCA RAR file, for headless application modules
          JCA 1.5 message endpoint management, for Spring-managed JMS and CCI message listeners

          小小的興奮了一把, 最后又不得不歸于失望, 繼續(xù)研究 XML 文件的編寫格式吧. 希望下次看到類似消息的時(shí)候能翻譯的準(zhǔn)確一些, 免得誤導(dǎo)偶等開(kāi)源軟件"消費(fèi)者".

           

          當(dāng)然了, 也歡迎 Spring 2.5 高人們向偶分享完全使用標(biāo)注的例子代碼, 那樣的話我真是太感謝了!




          文章來(lái)源:http://www.aygfsteel.com/beansoft/archive/2007/11/23/162700.html

          posted @ 2007-11-30 20:57 J2EE UP UP 閱讀(366) | 評(píng)論 (0)編輯 收藏

          MyEclipse 6 實(shí)戰(zhàn)開(kāi)發(fā)講解視頻入門 7 Struts 入門開(kāi)發(fā) – 簡(jiǎn)單登錄

          本視頻根據(jù)自己翻譯的 MyEclipse 官方教材制作了對(duì)應(yīng)的視頻, 視頻具體內(nèi)容請(qǐng)參考 翻譯: MyEclipse Struts 1.x 教程(PDF格式).

          友情提示: 下載微軟網(wǎng)盤文件時(shí)關(guān)閉下載工具否則你將得到錯(cuò)誤的文件, 雙擊 EXE 會(huì)出來(lái) DOS 窗口. 正確操作是點(diǎn)擊文件名后能看到顯示下載鏈接和文件大小等信息.

          代碼: http://cid-519b3f7aa2172030.skydrive.live.com/self.aspx/Public/MyEclipse6Videos/7_StrutsLoginDemo.zip  20.5 KB

          視頻:  http://cid-519b3f7aa2172030.skydrive.live.com/self.aspx/Public/MyEclipse6Videos/myeclipse6_7.exe  19分45秒 8.0 MB

          1. 前言
          2. 簡(jiǎn)介
          3. 系統(tǒng)需求
          4. 設(shè)置新項(xiàng)目和目錄結(jié)構(gòu)
          5. 開(kāi)始 Struts 項(xiàng)目
            1. Struts 項(xiàng)目的組成部分
            2. 構(gòu)造我們的應(yīng)用
          6. 運(yùn)行示例代碼
          7. 小結(jié)
          8. 用戶反饋

          視頻截圖:
          myeclipse6_7




          文章來(lái)源:http://www.aygfsteel.com/beansoft/archive/2007/11/26/163354.html

          posted @ 2007-11-30 20:57 J2EE UP UP 閱讀(205) | 評(píng)論 (0)編輯 收藏

          這是 MyEclipse 幫助文檔中的內(nèi)容的翻譯, 點(diǎn)擊菜單 Help -> Contents 可以看到 MyEclipse 的全部英文幫助文檔.

          在線閱讀(完整內(nèi)容含 Flash 動(dòng)畫(huà)): http://beansoft.java-cn.org/myeclipse_doc_cn/springintroduction/

          下載: http://cid-519b3f7aa2172030.skydrive.live.com/self.aspx/Public/MyEclipse中文文檔/MyEclipse Spring 快速入門.zip 2.31MB 

          友情提示: 下載微軟網(wǎng)盤文件時(shí)關(guān)閉下載工具,  否則你將得到錯(cuò)誤的文件, 雙擊 EXE 會(huì)出來(lái) DOS 窗口. 正確操作是點(diǎn)擊文件名后能看到顯示下載鏈接和文件大小等信息.

          MyEclipse Spring 入門教程
          翻譯: 劉長(zhǎng)炯 BeanSoft@126.com
          Blog: http://www.aygfsteel.com/beansoft/
          日期: 2007-11-26
          聲明: 中文文字版權(quán)歸 劉長(zhǎng)炯 所有, 原文及相關(guān)的圖片等資源的版權(quán)歸原作者 Genuitec L.L.C 公司所有.

          目錄

          1. 簡(jiǎn)介
          2. 建議的聽(tīng)眾
          3. 系統(tǒng)需求
          4. Spring 介紹
          5. 開(kāi)始工作
          6. 可視化項(xiàng)目
          7. 理解和運(yùn)行代碼
          8. 修改項(xiàng)目
          9. 小結(jié)
          10. FAQ
          11. 資源
          12. 反饋

           

           

          本人原創(chuàng) MyEclipse 6 幫助文檔中文版集中下載

          http://cid-519b3f7aa2172030.skydrive.live.com/browse.aspx/Public/MyEclipse中文文檔




          文章來(lái)源:http://www.aygfsteel.com/beansoft/archive/2007/11/27/163416.html

          posted @ 2007-11-30 20:57 J2EE UP UP 閱讀(692) | 評(píng)論 (0)編輯 收藏

          MyEclipse 6 實(shí)戰(zhàn)開(kāi)發(fā)講解視頻入門 8 XFire Web Service 入門開(kāi)發(fā)

          本視頻根據(jù) MyEclipse 幫助文檔制作的對(duì)應(yīng)的視頻.

          友情提示: 下載微軟網(wǎng)盤文件時(shí)關(guān)閉下載工具否則你將得到錯(cuò)誤的文件, 雙擊 EXE 會(huì)出來(lái) DOS 窗口. 正確操作是點(diǎn)擊文件名后能看到顯示下載鏈接和文件大小等信息.

          代碼:http://cid-519b3f7aa2172030.skydrive.live.com/self.aspx/Public/MyEclipse6Videos/8_WebService.zip  29 KB

          視頻:  http://cid-519b3f7aa2172030.skydrive.live.com/self.aspx/Public/MyEclipse6Videos/myeclipse6_8.exe   19分16秒 7.4 MB

          1. 簡(jiǎn)介 MyEclipse on XFire 1.2
          2. 創(chuàng)建 Web Service Project
          3. 開(kāi)發(fā)簡(jiǎn)單的 Web Service
          4. 發(fā)布運(yùn)行項(xiàng)目, 顯示 WSDL
          5. 用 Web Service Explorer 測(cè)試
          6. 編寫基于 XFire  API 的客戶端并運(yùn)行測(cè)試
          7. 新建單獨(dú)的 Web Service 客戶端項(xiàng)目
          8. 根據(jù) WSDL 和 JAXB 生成客戶端代碼
          9. 調(diào)用客戶端代碼并運(yùn)行測(cè)試代碼

          視頻截圖:

           

          image




          文章來(lái)源:http://www.aygfsteel.com/beansoft/archive/2007/11/29/163907.html

          posted @ 2007-11-30 20:57 J2EE UP UP 閱讀(866) | 評(píng)論 (0)編輯 收藏

          本視頻根據(jù)自己翻譯的 MyEclipse 官方教材制作了對(duì)應(yīng)的視頻, 視頻具體內(nèi)容請(qǐng)參考 MyEclipse JSF 快速入門中文版.

          友情提示: 下載微軟網(wǎng)盤文件時(shí)關(guān)閉下載工具否則你將得到錯(cuò)誤的文件, 雙擊 EXE 會(huì)出來(lái) DOS 窗口. 正確操作是點(diǎn)擊文件名后能看到顯示下載鏈接和文件大小等信息.

          代碼: http://cid-519b3f7aa2172030.skydrive.live.com/self.aspx/Public/MyEclipse6Videos/9_JSFLoginDemo.zip  9 KB

          視頻:  http://cid-519b3f7aa2172030.skydrive.live.com/self.aspx/Public/MyEclipse6Videos/myeclipse6_9.exe  15分31秒 6.6 MB

          內(nèi)容包括:

          1.新建 Web Project

          2. 添加 JSF 功能

          3. 創(chuàng)建 Message Bundle

          4. 創(chuàng)建 Managed Bean

          5. 創(chuàng)建 userLogin.jsp

          6. 創(chuàng)建 userLoginSuccess.jsp

          7. 創(chuàng)建 導(dǎo)航規(guī)則

          8. 發(fā)布并測(cè)試

          9. 加入中文消息包

          10. 測(cè)試

           

          視頻截圖:

          image




          文章來(lái)源:http://www.aygfsteel.com/beansoft/archive/2007/11/30/164166.html

          posted @ 2007-11-30 20:57 J2EE UP UP 閱讀(275) | 評(píng)論 (0)編輯 收藏

           

          研究了很久新出的 Spring 2.5, 總算大致明白了如何用標(biāo)注定義 Bean, 但是如何定義和注入類型為 java.lang.String 的 bean 仍然未解決, 希望得到高人幫助.

          總的來(lái)看 Java EE 5 的標(biāo)注開(kāi)發(fā)方式開(kāi)來(lái)是得到了大家的認(rèn)可了.

          @Service 相當(dāng)于定義 bean, 自動(dòng)根據(jù) bean 的類名生成一個(gè)首字母小寫的 bean

          @Autowired 則是自動(dòng)注入依賴的類, 它會(huì)在類路徑中找成員對(duì)應(yīng)的類/接口的實(shí)現(xiàn)類, 如果找到多個(gè), 需要用 @Qualifier("chineseMan") 來(lái)指定對(duì)應(yīng)的 bean 的 ID.

          一定程度上大大簡(jiǎn)化了代碼的編寫, 例如一對(duì)一的 bean 映射現(xiàn)在完全不需要寫任何額外的 bean 定義了.

          下面是代碼的運(yùn)行結(jié)果:

          man.sayHello()=抽你丫的
          SimpleMan said: Hi
          org.example.EnglishMan@12bcd4b said: Fuck you!

           

          代碼:

          beans.xml

          <?xml version="1.0" encoding="UTF-8"?>
          <beans xmlns="http://www.springframework.org/schema/beans"
                 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                 xmlns:context="http://www.springframework.org/schema/context"
                 xsi:schemaLocation="http://www.springframework.org/schema/beans 
                     http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
                     http://www.springframework.org/schema/context
                     http://www.springframework.org/schema/context/spring-context-2.5.xsd">
               <context:annotation-config/>
               <context:component-scan base-package="org.example"/>
               
          </beans>

          測(cè)試類:

          import org.example.IMan;
          import org.example.SimpleMan;
          import org.springframework.context.ApplicationContext;
          import org.springframework.context.support.ClassPathXmlApplicationContext;

          public class SpringTest {
              public static void main(String[] args) {
                  ApplicationContext ctx = new ClassPathXmlApplicationContext("beans.xml");
                  SimpleMan dao = (SimpleMan) ctx.getBean("simpleMan");
                  System.out.println(dao.hello());
                  IMan man = (IMan) ctx.getBean("usMan");
                  System.out.println(man.sayHello());
              }
          }

          自動(dòng)探測(cè)和注入bean的類:

          package org.example;

          import org.springframework.beans.factory.annotation.Autowired;
          import org.springframework.beans.factory.annotation.Qualifier;
          import org.springframework.stereotype.Service;

          @Service
          public class SimpleMan {
              // 自動(dòng)注入名稱為 Man 的 Bean
              @Autowired(required = false)
              @Qualifier("chineseMan")
              //@Qualifier("usMan")
              private IMan man;   

              /**
               * @return the man
               */
              public IMan getMan() {
                  return man;
              }

              /**
               * @param man the man to set
               */
              public void setMan(IMan man) {
                  this.man = man;
              }

              public String hello() {
                  System.out.println("man.sayHello()=" + man.sayHello());
                  return "SimpleMan said: Hi";
              }
          }

           

          一個(gè)接口和兩個(gè)實(shí)現(xiàn)類:

          package org.example;

          /**
          * 抽象的人接口.
          * @author BeanSoft
          * @version 1.0
          */
          public interface IMan {
              /**
               * 打招呼的抽象定義.
               * @return 招呼的內(nèi)容字符串
               */
              public String sayHello();
          }

           

          package org.example;

          import org.springframework.stereotype.Service;

          /**
          * 中國(guó)人的實(shí)現(xiàn).
          * @author BeanSoft
          */
          @Service
          public class ChineseMan implements IMan {

              public String sayHello() {
                  return "抽你丫的";
              }

          }

           

          package org.example;

          import org.springframework.stereotype.Service;

          /**
          * @author BeanSoft
          * 美國(guó)大兵
          */
          @Service("usMan")
          // 這里定義了一個(gè) id 為 usMan 的 Bean, 標(biāo)注里面的屬性是 bean 的 id
          public class EnglishMan implements IMan {

              public String sayHello() {
                  return this + " said: Fuck you!";
              }

          }


          文章來(lái)源:http://www.aygfsteel.com/beansoft/archive/2007/11/30/164230.html

          posted @ 2007-11-30 20:57 J2EE UP UP 閱讀(279) | 評(píng)論 (0)編輯 收藏

          好好努力吧,技術(shù)上全面突破

          posted @ 2007-10-24 22:41 J2EE UP UP 閱讀(131) | 評(píng)論 (0)編輯 收藏

               摘要:   閱讀全文


          文章來(lái)源:http://www.aygfsteel.com/beansoft/archive/2007/10/24/155586.html

          posted @ 2007-10-24 14:21 J2EE UP UP 閱讀(164) | 評(píng)論 (0)編輯 收藏

          這個(gè)分頁(yè)代碼基于 JDBC 2.0 的滾動(dòng)游標(biāo)的機(jī)制, 核心觀念就是利用 ResultSet 類里面的 boolean absolute( int row ) throws SQLException 方法進(jìn)行數(shù)據(jù)的跳轉(zhuǎn).

          經(jīng)過(guò)測(cè)試(數(shù)據(jù)小于1萬(wàn)條, SQL Server 2000), 這個(gè)方法比用復(fù)合 SQL 語(yǔ)句查詢分頁(yè)的方案要快很多.

          詳細(xì) JavaDoc 如下:

          Moves the cursor to the given row number in this ResultSet object.

          If the row number is positive, the cursor moves to the given row number with respect to the beginning of the result set. The first row is row 1, the second is row 2, and so on.

          If the given row number is negative, the cursor moves to an absolute row position with respect to the end of the result set. For example, calling the method absolute(-1) positions the cursor on the last row; calling the method absolute(-2) moves the cursor to the next-to-last row, and so on.

          An attempt to position the cursor beyond the first/last row in the result set leaves the cursor before the first row or after the last row.

          Note: Calling absolute(1) is the same as calling first(). Calling absolute(-1) is the same as calling last().

          Parameters:

          row the number of the row to which the cursor should move. A positive number indicates the row number counting from the beginning of the result set; a negative number indicates the row number counting from the end of the result set

          Returns:

          true if the cursor is on the result set; false otherwise

          Throws:

          SQLException if a database access error occurs, or the result set type is TYPE_FORWARD_ONLY

          @since

          1.2

          /*
          
          * @(#)Pager.java 1.00 2004-8-12
          
          *
          
          * Copyright 2004 . All rights reserved.
          
          * PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
          
          */
          
          import java.sql.Connection;
          
          import java.sql.ResultSet;
          
          import java.sql.Statement;
          
          import java.util.Vector;
          
          /**
          
          * Pager, 基于 JDBC 2.0 滾動(dòng)機(jī)制的分頁(yè)程序, 在 MySQL, SQLServer, Access, Oracle 下測(cè)試通過(guò).
          
          * @author 劉長(zhǎng)炯
          
          * @version 1.0 2004-8-12
          
          */
          
          public class Pager {
          
          /** Used database connection */
          
          Connection conn = null;
          
          public Pager() {
          
          }
          
          /**
          
          * 分頁(yè)功能, 返回當(dāng)頁(yè)的數(shù)據(jù)(JDBC 2.0 實(shí)現(xiàn)).
          
          * 
          
          * @param currentPage
          
          * 當(dāng)前頁(yè)面數(shù)(取值范圍: 從 1 開(kāi)始有效, 0 自動(dòng)改為 1)
          
          * @param pageCount
          
          * 每頁(yè)顯示記錄數(shù)
          
          * 
          
          * @return a Vector - 數(shù)據(jù)列表
          
          */
          
          public Vector pageData(int currentPage, int pageCount) {
          
          Vector results = new Vector();
          
          String tableName = "table_name";// 要處理的表格名
          
          ResultSet rs = null;
          
          String sql = "SELECT * FROM " + tableName;
          
          Statement stmt = null;
          
          try {
          
          // TODO: open connection
          
          // 生成可滾動(dòng)的結(jié)果集表達(dá)式
          
          stmt = conn.createStatement(ResultSet.
          
          TYPE_SCROLL_SENSITIVE,
          
          ResultSet.CONCUR_READ_ONLY);
          
          rs = stmt.executeQuery(sql);
          
          int count = recordCount(); // 總記錄數(shù)
          
          int totalPage = (int) Math.ceil(1.0 * count / pageCount); // 總頁(yè)面數(shù)
          
          if (currentPage <= 0) {
          
          currentPage = 1;
          
          }
          
          // 超出頁(yè)碼范圍, 不返回?cái)?shù)據(jù)
          
          if (currentPage > totalPage) {
          
          currentPage = totalPage;
          
          return results;
          
          }
          
          if ((currentPage - 1) * pageCount > 0) {
          
          // 移動(dòng)結(jié)果集數(shù)據(jù)到當(dāng)前頁(yè)
          
          rs.absolute((currentPage - 1) * pageCount);
          
          }
          
          // rs.absolute(0); 在 ODBC 下會(huì)導(dǎo)致如下異常:java.sql.SQLException: Cursor
          
          // position (0) is invalid
          
          int i = 0; // Readed pages
          
          while (rs.next() && i < pageCount) {
          
          i++;
          
          // TODO: Read each row and process to value object
          
          ValueObject bean = new ValueObject();
          
          // TODO: Read value to value object
          
          result.add(bean);
          
          }
          
          } catch (Exception exception) {
          
          System.out.println("Occur a error in " + getClass()
          
          + ".pageData() : " + exception.getMessage());
          
          // exception.printStackTrace();
          
          } finally {
          
          closeJDBCResource(stmt);
          
          closeJDBCResource(rs);
          
          closeJDBCResource(conn);
          
          }
          
          return results;
          
          }
          
          /**
          
          * 返回當(dāng)前數(shù)據(jù)庫(kù)中記錄的總數(shù).
          
          * 
          
          * @return int 記錄總數(shù)
          
          */
          
          public int recordCount() {
          
          int allCount = -1;
          
          String tableName = "table_name";// 要處理的表格名
          
          String sql = "SELECT COUNT(*) FROM " + tableName;
          
          ResultSet rs = null;
          
          Statement stmt = null;
          
          try {
          
          // TODO: open connection
          
          stmt = conn.createStatement();
          
          rs = stmt.executeQuery(sql);
          
          if (rs.next()) {
          
          allCount = rs.getInt(1);
          
          }
          
          } catch (Exception exception) {
          
          System.out
          
          .println("Occur a error in " + getClass()
          
          + ".recordCount() : " + exception.getMessage());
          
          } finally {
          
          closeJDBCResource(stmt);
          
          closeJDBCResource(rs);
          
          closeJDBCResource(conn);
          
          }
          
          return allCount;
          
          }
          
          /**
          
          * Close a jdbc resource, such as ResultSet, Statement, Connection.... All
          
          * these objects must have a method signature is void close().
          
          * 
          
          * @param resource -
          
          * jdbc resouce to close
          
          */
          
          public static void closeJDBCResource(Object resource) {
          
          try {
          
          Class clazz = resource.getClass();
          
          java.lang.reflect.Method method = clazz.getMethod("close", null);
          
          method.invoke(resource, null);
          
          } catch (Exception e) {
          
          e.printStackTrace();
          
          }
          
          }
          
          /**
          
          * Test page.
          
          * @param args
          
          */
          
          public static void main(String[] args) {
          
          // 分頁(yè), 讀取第一頁(yè)數(shù)據(jù), 共讀取5個(gè)記錄
          
          Vector data = new Pager().pageData(1, 5);
          
          // TODO: process value object, 更改類名
          
          for(int i = 0; results != null && i < data.size(); i++) {
          
          ValueObject bean = (ValueObject)data.get(i);
          
          }
          
          }
          
          }
          



          文章來(lái)源:http://www.aygfsteel.com/beansoft/archive/2007/10/23/155318.html

          posted @ 2007-10-23 16:00 J2EE UP UP 閱讀(204) | 評(píng)論 (0)編輯 收藏

          2005 年的時(shí)候幫人收集整理修改的一份腳本級(jí)聯(lián)菜單, 沒(méi)用到 AJAX, 寫死的數(shù)據(jù). 效果自己試試就知道了. 支持主流瀏覽器. 自己現(xiàn)在看看這代碼就覺(jué)得頭大... 呵呵 腳本就是腳本啊. 一段時(shí)間放下就看不懂了.

           

          三級(jí)關(guān)聯(lián)菜單

           

          <HTML>
          <HEAD>
          <TITLE>合同申請(qǐng)</TITLE>
          <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
          <SCRIPT LANGUAGE = JavaScript>
          /** Define object Dsy 構(gòu)造器
          fieldValues - 三個(gè)表單域的名稱, 可以通過(guò) request.getParameter(xxx) 取值
          defalutOptions - 默認(rèn)選項(xiàng)
          */
          function Dsy(fieldValues, defalutOptions){
            this.Items = {};
            this.defalutOptions = defalutOptions;// 默認(rèn)選項(xiàng) 
            this.fieldValues = fieldValues;// 三個(gè)表單域的名稱
          }

          Dsy.prototype.add = function(id, iArray){
            this.Items[id] = iArray;
          }

          Dsy.prototype.Exists = function(id){
            if (typeof(this.Items[id]) == "undefined")
              return false;
            return true;
          };

          Dsy.prototype.setup = function() {
              this.bean_change(0);
          }

          // This prototype method added by BeanSoft Studio
          Dsy.prototype.bean_change = function(v){
            var str = "0";
            for (i = 0; i < v; i++){
              str += ("_" + (document.getElementById(this.fieldValues[i]).selectedIndex - 1));
            };

            var ss = document.getElementById(this.fieldValues[v]);
            // Avoid a null exception
            if(ss == null) return;

              with(ss){
                length = 0;
                options[0] = new Option(this.defalutOptions[v], this.defalutOptions[v]);
                if (v && document.getElementById(this.fieldValues[v - 1]).selectedIndex > 0 || !v){
                  if (this.Exists(str)){
                    array = this.Items[str];
                    for (i = 0; i < array.length; i++)
                      options[length] = new Option(array[i], array[i]);
                    if (v)
                      options[1].selected = true;
                  }
                }

                if (++v < s.length){
                  this.bean_change(v);
                }
              }
          }

            function change(v){   
              dsy.bean_change(v);// Call test prototype
            }

            // Write form data string, 輸出表單腳本代碼
            // dsy, object name
            // varName, 變量名
            function toString(dsy, varName) {
              var str = "";
              for(i = 0; i < dsy.fieldValues.length; i++) {
                  str += "<select id=\"" + dsy.fieldValues[i] + "\" onChange=\"" + varName + ".bean_change(" + (i + 1)
                      + ");\"></select>\r\n";
              }
              str += "<br/>";
              return str;
            }

          // 第一個(gè)對(duì)象
            var dsy = new Dsy(["s1", "s2", "s3"], ["銷售方名稱", "銷售方聯(lián)系人", "聯(lián)系電話"]);
            var dsy1 = new Dsy(["s4", "s5", "s6"],  ["最終用戶名稱", "最終用戶聯(lián)系人", "聯(lián)系電話"]);
            var dsy2 = new Dsy(s = ["s7", "s8", "s9"], ["廠商", "廠商銷售", "聯(lián)系電話"]);

          // 填入數(shù)據(jù), 重復(fù)的代碼
            dsy.add("0", ["亞信", "航天理想"]);

            dsy.add("0_0", ["亞信聯(lián)系人_1", "亞信聯(lián)系人_2"]);
            dsy.add("0_0_0", ["亞信聯(lián)系人_1聯(lián)系電話"]);
            dsy.add("0_0_1", ["亞信聯(lián)系人_2聯(lián)系電話"]);

            dsy.add("0_1", ["航天理想聯(lián)系人_1", "航天理想聯(lián)系人_2"]);
            dsy.add("0_1_0", ["航天理想聯(lián)系人_1聯(lián)系電話"]);
            dsy.add("0_1_1", ["航天理想聯(lián)系人_2聯(lián)系電話"]);

            dsy1.add("0", ["最終用戶1", "最終用戶2"]);

            dsy1.add("0_0", ["最終用戶1_聯(lián)系人1", "最終用戶1_聯(lián)系人2"]);
            dsy1.add("0_0_0", ["最終用戶1_聯(lián)系人1_電話"]);
            dsy1.add("0_0_1", ["最終用戶1_聯(lián)系人2_電話"]);

            dsy1.add("0_1", ["最終用戶2_聯(lián)系人1", "最終用戶2_聯(lián)系人2"]);
            dsy1.add("0_1_0", ["最終用戶2_聯(lián)系人1_電話"]);
            dsy1.add("0_1_1", ["最終用戶2_聯(lián)系人2_電話"]);

            dsy2.add("0", ["BEA", "Horizon"]);

            dsy2.add("0_0", ["張學(xué)友", "BeanSoft"]);
            dsy2.add("0_0_0", ["1234567890"]);
            dsy2.add("0_0_1", ["beansoft@126.com"]);

            dsy2.add("0_1", ["AAA", "BBB"]);
            dsy2.add("0_1_0", ["AAA_99999"]);
            dsy2.add("0_1_1", ["bbb_88888"]);

            function setup(){  // Initialize the object
              dsy.setup(); //依次調(diào)用 setup
              dsy1.setup();
              dsy2.setup();
            }

          function prints1(){
              alert(document.frm.s1.value + " " + document.frm.s2.value + " " + document.frm.s3.value +"\r\n");
          }

          //isNaN()檢查運(yùn)算結(jié)果  http://tech.ccidnet.com/pub/article/c1115_a120997_p1.html

          </SCRIPT>

          </head>
          <body bgcolor="#E0E0E0" onload="setup()">
          多級(jí)關(guān)聯(lián)菜單:
          <form name="frm">

          <!-- 方式1: 手工輸出 HTML 代碼, 便于排版
          <select id="s1" onChange="dsy.bean_change(1);"></select>
          <select id="s2" onChange="dsy.bean_change(2);"></select>
          <select id="s3" onChange="dsy.bean_change(3);"></select>
          <br>
          <br>
          <br>
          <select id="s4" onChange="dsy1.bean_change(1);"></select>
          <select id="s5" onChange="dsy1.bean_change(2);"></select>
          <select id="s6" onChange="dsy1.bean_change(3);"></select>
          <br>
          <br>
          <br>
          <select id="s7" onChange="dsy2.bean_change(1);"></select>
          <select id="s8" onChange="dsy2.bean_change(2);"></select>
          <select id="s9" onChange="dsy2.bean_change(3);"></select>
          -->
          <SCRIPT LANGUAGE="JavaScript">
          <!--
          // 方式2: 腳本輸出表單 HTML 代碼, 代碼和上面注釋掉的類似
          document.write(toString(dsy, "dsy"));
          document.write(toString(dsy1, "dsy1"));
          document.write(toString(dsy2, "dsy2"));
          //-->
          </SCRIPT>

          <input type=button name=b1 value="監(jiān)測(cè)" onclick="prints1()">

          </form>

          </body>
          </html>




          文章來(lái)源:http://www.aygfsteel.com/beansoft/archive/2007/10/22/154898.html

          posted @ 2007-10-22 10:43 J2EE UP UP 閱讀(254) | 評(píng)論 (0)編輯 收藏

          注: 昨天用 VMWare 試了試 Fedora Live, 下載地址: ftp://download.fedora.redhat.com/pub/fedora/linux/releases/7/Live/i386/ 里面的兩個(gè) ISO 隨便下一個(gè)就行了, 還不錯(cuò), 安裝后登錄選擇語(yǔ)言, 竟然支持中文和中文輸入法, 要知道現(xiàn)在想找個(gè)安裝包為700MB 的 Linux 還能支持中文的還真不多啊. 不過(guò)感覺(jué)有點(diǎn)吃內(nèi)存, 響應(yīng)上不如 RedHat 快. 安裝后占用了 2.54 G 的空間.

          image

          June 5th, 2007

          Fedora 7 Live 安裝手記

          Category: Ubuntu, Author: Nicky, Popularity: 30%

          fedora-logo.png
          這次 Fedora 7 提供的 CD 鏡像分為兩大版本,F(xiàn)edora 7 Live 和 Fedora 7 KDE Live,前者默認(rèn)采用 GNOME 桌面環(huán)境,后者集成 KDE 環(huán)境,只有在 DVD 版中才同時(shí)提供 GNOME 和 KDE 這兩個(gè)供選擇。用過(guò) Redhat Linux 的都知道,在安裝的時(shí)候可以選擇一個(gè)桌面環(huán)境,也可以同時(shí)選擇它們,現(xiàn)在 Fedora 7 真有點(diǎn) Ubuntu 和 Kubuntu 的意思。我下載的是 Fedora 7 Live i686 來(lái)嘗試,整個(gè)安裝過(guò)程分為兩方面,安裝和配置,共 16 大步驟,花了我 30 張截圖,不過(guò)絕大多數(shù)設(shè)置默認(rèn)就行,重點(diǎn)還是在分區(qū)上。

          下面是安裝全過(guò)程。

          一、進(jìn)入 Live 桌面

          1、下載 Fedora 7 Live,設(shè)置為光盤啟動(dòng)后,選擇第一個(gè)從光盤鏡像啟動(dòng)。

          2、直接回車進(jìn)入

          3、進(jìn)入到 Live 桌面

          這種 Live 安裝方式,對(duì)桌面用戶來(lái)說(shuō)是最爽的。

          二、進(jìn)行安裝

          1、雙擊桌面 install to fedora 圖標(biāo)開(kāi)始安裝。

          2、選擇鍵盤布局。

          3、問(wèn)你是否初始化這個(gè)驅(qū)動(dòng)器,選擇 Yes,否則無(wú)法繼續(xù)。

          4、開(kāi)始分區(qū),選擇 Create custom layout,自定義分區(qū)。

          Linux 分區(qū)和文件系統(tǒng)的選擇可以參考這篇文章

          可惜不提供 ReiserFS 文件系統(tǒng)的選擇。

          分區(qū)結(jié)束,點(diǎn)擊 Next。

          如果提示 Low Memory,選擇 Yes。

          5、選擇 GRUB 安裝位置,點(diǎn)擊 Next。

          6、網(wǎng)絡(luò)設(shè)備配置,可以讓它默認(rèn),點(diǎn)擊 Next。

          7、選擇時(shí)區(qū),可以在下拉菜單中選擇,建議直接在地圖上點(diǎn)擊。

          8、設(shè)置超級(jí)用戶 root 的口令。

          9、安裝配置結(jié)束,點(diǎn)擊 Next 開(kāi)始進(jìn)行安裝。

          自動(dòng)安裝過(guò)程

          10、安裝結(jié)束,點(diǎn)擊 Close 重新引導(dǎo)系統(tǒng)。

          三、安裝后的設(shè)置

          1、重新引導(dǎo),進(jìn)入 GRUB 畫(huà)面。

          可以看到核心是 2.6.21,比 Ubuntu 7.04 稍高一點(diǎn)。

          啟動(dòng)畫(huà)面很漂亮。

          2、開(kāi)始進(jìn)行設(shè)置,這里面大多數(shù)都可以默認(rèn),直接 Forward 就是。

          3、直接 Forward。

          4、選擇在哪些服務(wù)上啟用防火墻,可以都不選擇。

          5、直接 Forward。

          6、設(shè)置時(shí)間。

          7、發(fā)送硬件信息到服務(wù)器,選 Do not send profile,點(diǎn)擊 Forward。

          再說(shuō)一次 No, do not send。

          8、建立個(gè)人帳戶信息

          如果提示口令太弱,不管它,點(diǎn)擊 Yes。

          9、聲卡設(shè)置,完成點(diǎn)擊 Finish。

          到這里 Fedora 7 Live 的安裝才算徹底完成了,雖然很多步驟可以默認(rèn),直接點(diǎn)擊下一步,但相比 Ubuntu 7 步加 15 分鐘安裝的過(guò)程,說(shuō)不繁瑣那是騙人的。

          來(lái)自: http://www.osxcn.com/ubuntu/fedora-7-installation-notes.html




          文章來(lái)源:http://www.aygfsteel.com/beansoft/archive/2007/10/20/154442.html

          posted @ 2007-10-20 10:18 J2EE UP UP 閱讀(311) | 評(píng)論 (0)編輯 收藏

          用戶可在 NetBeans 中開(kāi)發(fā) JSR 295 (Beans Binding) 和 JSR 296 (Swing Application Framework) 的應(yīng)用。本教程演示了這一過(guò)程。

           




          文章來(lái)源:http://www.aygfsteel.com/beansoft/archive/2007/10/19/154173.html

          posted @ 2007-10-19 13:09 J2EE UP UP 閱讀(1266) | 評(píng)論 (0)編輯 收藏

          從網(wǎng)上找的版本呢, 有白邊. 今天花時(shí)間改進(jìn)了一下, 效果打開(kāi)頁(yè)面的時(shí)候你就應(yīng)該看到了. 如果配合 AJAX 做基于網(wǎng)頁(yè)版 Outlook 通知的話會(huì)有一點(diǎn)點(diǎn)用. 首先感謝最初的原作者(轉(zhuǎn)載的太多了, 找不到了).

          顯示效果:

          image
          其實(shí)有人做的有更好的版本, 參考這里(也是僅支持IE的):
          Web的桌面提醒(Popup) 效果演示: http://webuc.net/MyProject/Popup/popup.htm
          下載: http://webuc.net/MyProject/Popup/popup.rar

          blogjava_popup_outlook

          < SCRIPT >
          var oPopup;
          try {
          oPopup
          = window.createPopup();
          }
          catch (e) {
          window.status
          = '彈出通知消息僅能用于 IE 下 ! ';
          }

          var popTop = 10 ;
          var mytime;

          function popmsg(msgstr){
          if ( ! oPopup) {
           
          return ;
          }
          oPopup.document.body.innerHTML
          = msgstr;
          popshow();
          }

          function popshow(){
          // window.status=popTop;
          if (popTop >   1720 ){
          clearTimeout(mytime);
          oPopup.hide();
          return ;
          }
          else   if (popTop >= 1720   -   108   && popTop <=   1720 ){
            oPopup.show(screen.width
          - 200 ,screen.height, 193 , 1720   - popTop);
          }
          else   if (popTop >= 1500   && popTop <   1720   -   108 ){
          oPopup.show(screen.width
          - 200 , screen.height -   220   + (popTop -   1500 ), 193 , 108 );
          }
          else   if (popTop <= 108 ){
          oPopup.show(screen.width
          - 200 , screen.height, 193 , popTop);
          }
          else   if (popTop <= 220 ){
          oPopup.show(screen.width
          - 200 , screen.height - popTop, 193 , 108 );
          }
          else {
           
          // window.status=popTop + "  else";
            oPopup.show(screen.width - 200 , screen.height - 220 , 193 , 108 );
          }

          popTop
          +=   10 ;
          mytime
          = setTimeout( " popshow(); " , 40 );
          }

          function hidePop() {
            clearTimeout(mytime);
            oPopup.hide();
          }

          popmsg(
          " <div onclick='window.parent.hidePop()' title='點(diǎn)擊隱藏' style='cursor:pointer; background-image: url(http://www.aygfsteel.com/images/blogjava_net/beansoft/18269/o_qqbg.gif); width:193; height:108; color:white; padding-top:1em; padding-left:5; font-size:11pt; color:white' ><center><b>BlogJava 系統(tǒng)消息<br><br>請(qǐng)留言或者捐款支持 BeanSoft 的 Java EE 學(xué)習(xí)視頻, 謝謝 !!</b></center></div> " );

          </ SCRIPT >

           

          最后來(lái)一個(gè)支持頁(yè)面內(nèi)的跨瀏覽器的:

          blogjava_popup_msn_in

          完美仿MSN右下角彈出廣告代碼并可自動(dòng)消失,附帶關(guān)閉按鈕.

          <html>
          <head>
          <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
          <title>先飛電腦技術(shù)網(wǎng)</title>
          </head>
          <Script language="JavaScript">
          <!--
          window.onload = getMsg;
          window.onresize = resizeDiv;
          window.onerror = function(){}
          //短信提示使用(asilas添加)
          var divTop,divLeft,divWidth,divHeight,docHeight,docWidth,objTimer,i = 0;
          function getMsg()
          {
              try{
              divTop = parseInt(document.getElementById("eMeng").style.top,10)
              divLeft = parseInt(document.getElementById("eMeng").style.left,10)
              divHeight = parseInt(document.getElementById("eMeng").offsetHeight,10)
              divWidth = parseInt(document.getElementById("eMeng").offsetWidth,10)
              docWidth = document.body.clientWidth;
              docHeight = document.body.clientHeight;
              document.getElementById("eMeng").style.top = parseInt(document.body.scrollTop,10) + docHeight + 10;//  divHeight
              document.getElementById("eMeng").style.left = parseInt(document.body.scrollLeft,10) + docWidth - divWidth
              document.getElementById("eMeng").style.visibility="visible"
              objTimer = window.setInterval("moveDiv()",10)
              }
              catch(e){}
          }

          function resizeDiv()
          {
              i+=1
              if(i>300) closeDiv()    //客戶想不用自動(dòng)消失由用戶來(lái)自己關(guān)閉所以屏蔽這句
              try{
              divHeight = parseInt(document.getElementById("eMeng").offsetHeight,10)
              divWidth = parseInt(document.getElementById("eMeng").offsetWidth,10)
              docWidth = document.body.clientWidth;
              docHeight = document.body.clientHeight;
              document.getElementById("eMeng").style.top = docHeight - divHeight + parseInt(document.body.scrollTop,10)
              document.getElementById("eMeng").style.left = docWidth - divWidth + parseInt(document.body.scrollLeft,10)
              }
              catch(e){}
          }

          function moveDiv()
          {
              try
              {
              if(parseInt(document.getElementById("eMeng").style.top,10) <= (docHeight - divHeight + parseInt(document.body.scrollTop,10)))
              {
              window.clearInterval(objTimer)
              objTimer = window.setInterval("resizeDiv()",1)
              }
              divTop = parseInt(document.getElementById("eMeng").style.top,10)
              document.getElementById("eMeng").style.top = divTop - 1
              }
              catch(e){}
          }
          function closeDiv()
          {
              document.getElementById('eMeng').style.visibility='hidden';
              if(objTimer) window.clearInterval(objTimer)
          }
          -->
          </Script>

          <!--溫馨提示代碼開(kāi)始-->

          <DIV id=eMeng style="BORDER-RIGHT: #455690 1px solid; BORDER-TOP: #a6b4cf 1px solid; Z-INDEX:99999; LEFT: 0px; VISIBILITY: hidden; BORDER-LEFT: #a6b4cf 1px solid; WIDTH: 180px; BORDER-BOTTOM: #455690 1px solid; POSITION: absolute; TOP: 0px; HEIGHT: 116px; BACKGROUND-COLOR: #c9d3f3">
              <TABLE style="BORDER-TOP: #ffffff 1px solid; BORDER-LEFT: #ffffff 1px solid" cellSpacing=0 cellPadding=0 width="100%" bgColor=#AFDCF3 border=0>
              <TBODY>
                  <TR bgColor=#6699cc>
                      <TD style="font-size: 12px; background-image: url('msgTopBg.gif'); color: #0f2c8c" width=30 height=24></TD>
                      <TD style="font-weight: normal; font-size: 12px; background-image: url('msgTopBg.gif'); color: #ffffff; padding-left: 4px; padding-top: 4px" vAlign=center width="100%"> 網(wǎng)站溫馨提示:</TD>
                      <TD style="background-image: url('msgTopBg.gif'); padding-right: 2px; padding-top: 2px" vAlign=center align=right width=19><span title=關(guān)閉 style="CURSOR: hand;color:white;font-size:12px;font-weight:bold;margin-right:4px;" onclick=closeDiv() >×</span><!--<IMG title=關(guān)閉 style="CURSOR: hand" onclick=closeDiv() hspace=3 src="msgClose.jpg">--></TD>
                  </TR>
                  <TR>
                      <TD style="background-image: url(' padding-right: 1px; padding-bottom: 1px" colSpan=3 height=90>
                          <DIV style="BORDER-RIGHT: #b9c9ef 1px solid; PADDING-RIGHT: 13px; BORDER-TOP: #728eb8 1px solid; PADDING-LEFT: 13px; FONT-SIZE: 12px; PADDING-BOTTOM: 13px; BORDER-LEFT: #728eb8 1px solid; WIDTH: 100%; COLOR: #1f336b; PADDING-TOP: 18px; BORDER-BOTTOM: #b9c9ef 1px solid; HEIGHT: 100%">先飛電腦技術(shù)網(wǎng)全新改版,免費(fèi)精品網(wǎng)絡(luò)資源,你用了嗎?<BR>
                          <DIV align=center style="word-break:break-all"><!--<a href="
          target="_blank">--><a href=" target="_blank">
                          <font color=#FF0000>進(jìn)入網(wǎng)站瀏覽</font></a></DIV>

                          </DIV>
                      </TD>
                  </TR>
              </TBODY>
              </TABLE>
          </DIV>
          <!--溫馨提示代碼結(jié)束-->
          </html>




          文章來(lái)源:http://www.aygfsteel.com/beansoft/archive/2007/10/18/154020.html

          posted @ 2007-10-18 23:03 J2EE UP UP 閱讀(312) | 評(píng)論 (0)編輯 收藏

          Struts 里面的 <html:text> 之類的表單域標(biāo)簽, 都有一個(gè)屬性叫: property, 這個(gè)屬性根據(jù)文檔是可以嵌套的, 例如下面的 formBean 嵌套了一個(gè)屬性 User:

          public class User {
            private String username;
            
            public String getUsername() {
              return username;
            }
            
            public void setUsername(String username) {
              this.username = username;
            }
          }

           

          public class UserForm extends FormBean {
            private User user;
            
            public User getUser() {
              return user;
            }
            
            public void setUser(User user) {
              this.user = user;
            }
          }

           

          那么對(duì)應(yīng)的 JSP 頁(yè)面里的  Tag 可以寫成:

          <html:text property="user.username" />

          但是如果這時(shí)候有人還想給生成的表單加入 JavaScript 驗(yàn)證的話, 必須用下面的寫法才能通過(guò):

          <script> // 表單驗(yàn)證函數(shù) function validateForm(form) { // this.user.username 會(huì)報(bào)錯(cuò) alert( this['user.username'] ); if(this['user.username'] .value == "") { alert("用戶名不能為空!"); return false; } return true; }
          </script>

          這是因?yàn)?Struts 標(biāo)簽最后產(chǎn)生的 HTML 如下所示:

           

          <form onsubmit="return validateForm(this);">
          <input name="user.username" />
          </form>

           

          直接引用 元素.user.username 肯定會(huì)出錯(cuò)的. 正確的方法參考上上面的代碼段即可.




          文章來(lái)源:http://www.aygfsteel.com/beansoft/archive/2007/10/17/153565.html

          posted @ 2007-10-17 14:24 J2EE UP UP 閱讀(816) | 評(píng)論 (0)編輯 收藏

          主站蜘蛛池模板: 孝义市| 桦南县| 宜宾县| 司法| 平远县| 荥阳市| 岢岚县| 新津县| 双桥区| 巴彦淖尔市| 峨眉山市| 鹰潭市| 东安县| 南华县| 达州市| 灵川县| 开封市| 九江县| 浑源县| 巴林左旗| 双辽市| 柳河县| 从江县| 金湖县| 岫岩| 汉寿县| 集贤县| 彰化市| 临桂县| 旬邑县| 如皋市| 两当县| 利辛县| 绥宁县| 德令哈市| 新绛县| 沂源县| 龙川县| 南郑县| 通海县| 六盘水市|