
使用 EasyUI 的 Datagrid 選擇到一筆記錄後,將這一筆完整的資料要送到後端 Java 接收,可以先轉換成 JSON 的格式再後送。
UI 的圖示如下,可以用 FireBug 去查看 JavaScript 裡的資料
MIS 發表在 痞客邦 留言(0) 人氣(516)

上次介紹 Spring Quartz Job Schedule Simple Example 工作排程器 ,現在再來使用 Spring 原生的 Task Execution and Scheduling,首先來瞭解一下 @Scheduled annotation 的意思
This annotation is used for task scheduling. The trigger information needs to be provided along with this annotation. You can use the properties fixedDelay/fixedRate/cron to provide the triggering information. 1. fixedRate: makes Spring run the task on periodic intervals even if the last invocation may be still running. 固定時間執行,不管上一次是否結束 2. fixedDelay: specifically controls the next execution time when the last execution finishes. 上一次執行結束後,再依設定的固定時間執行 3. cron: is a feature originating from Unix cron utility and has various options based on your requirements. BJ4(就不解釋了) |
MIS 發表在 痞客邦 留言(0) 人氣(305)

Struts 2 Customize Theme & Freemarker Template 客制佈景與模板 說明了Struts2 的 tags 是可以自行客制成自已想要的佈景,現在來說明如何使用 FreeMarker 來制作 Struts2 屬於自已建作的 tag libs.
工具:
MIS 發表在 痞客邦 留言(0) 人氣(137)

Struts 2 使用 FreeMarker 來作模板(Template) ,預設的模板是 xhtml (可以解開 struts2-core-2.3.x.x.jar 取得),若要客制佈景(Theme)與模板(Template),需要下列幾個步驟。
預計想要達成的效果有
1. Freemarker Template 中可以使用 Struts 的 tag
2. Customize Theme 客製顏色佈景
MIS 發表在 痞客邦 留言(0) 人氣(250)

From: Polin Wei
經實作測試,可以正常運作。故記錄之.....
環境:
struts2: 2.3.16.3
MIS 發表在 痞客邦 留言(0) 人氣(1,361)
在 Struts2 的異常處理有兩種,一種是程式撰寫的邏輯出錯,另一種是找不到 action Name : There is no Action mapped for namespace...,避免系統出錯的改善作法如下:
程式撰寫的邏輯出錯:
在 Struts.xml 內加入
MIS 發表在 痞客邦 留言(0) 人氣(272)
繼 Struts 2 對於 Interceptor 攔截器的基本概念與實作 的瞭解後,我們現在來作一下 Interceptor 在 Struts 2 上的基本運用。
首先建立一個 class : com.test.interceptor.MyInterceptor 並且 implements Interceptor,這個 Interceptor 是個 Interface,所以需要實作三個 method:init()、destroy()、intercept(ActionInvocation invocation),其中只有 intercept(ActionInvocation invocation) 需要回傳一個 String 的值,可以利用 invocation.invoke(); 來讓系統自已跳到預設的下一個 Action method。
MIS 發表在 痞客邦 留言(0) 人氣(3,153)
Struts 2 支援 POJO 的程式撰寫,所以可以指定 Action Method 來執行您在 struts.xml 中的設定。
<action name="userLogout" method="logout" class="com.gu.EipLogin"> <result>eip_home.jsp</result> </action> |
MIS 發表在 痞客邦 留言(0) 人氣(585)
Struts 2 在 struts2-core-2.x.x.jar 的 struts-default.xml 中也設定了許多的 Interceptor 攔截器,Interceptor 攔截器的基本概念大致整理如下:
1. 要有目標對象
2. 攔截器本身,在攔截器本身安插要執行的作業
3. 由 java.lang.reflect.InvocationHandler 來讓 目標對象 與 攔截器 產生關連
MIS 發表在 痞客邦 留言(1) 人氣(746)