[轉]Spring加載resource時classpath*:與classpath:的區別
摘要: Spring可以通過指定classpath*:與classpath:前綴加路徑的方式從classpath加載文件,如bean的定義文件.classpath*:的出現是為了從多個jar文件中加載相同的文件.classpath:只能加載找到的第一個文件.
閱讀全文
posted @
2011-10-14 11:58 Ke 閱讀(758) |
評論 (0) 編輯
struts2 + spring, 使用session範圍的Bean的配置事項
摘要: 異常信息:
Scope 'session' is not active for the current thread; consider defining a scoped proxy for this bean if you intend to refer to it from a singleton; nested exception is java.lang.IllegalStateException: No thread-bound request found: Are you referring to request attributes outside of an actual web request, or processing a request outside of the originally receiving thread? If you are actually operating within a web request and still receive this message, your code is probably running out
閱讀全文
posted @
2011-09-06 10:22 Ke 閱讀(1881) |
評論 (1) 編輯
spring注解入門(轉)
摘要:
的base-package屬性指定了需要掃描的類包,類包及其遞歸子包中所有的類都會被處理。
還允許定義過濾器將基包下的某些類納入或排除。Spring支持以下4種類型的過濾方式:
* 過濾器類型 表達式范例 說明
* 注解 org.example.SomeAnnotation 將所有使用SomeAnnotation注解的類過濾出來
* 類名指定 org.example.SomeClass 過濾指定的類
* 正則表達式 com\.kedacom\.spring\.annotation\.web\..* 通過正則表達式過濾一些類
* AspectJ表達式 org.example..*Service+ 通過AspectJ表達式過濾一些類
閱讀全文
posted @
2009-09-15 15:20 Ke 閱讀(378) |
評論 (0) 編輯
用Spring的JdbcTemplate實現分頁功能
摘要: Oracle數據庫,使用偽列ROWNUM來實現分頁。
閱讀全文
posted @
2008-04-20 19:32 Ke 閱讀(5019) |
評論 (0) 編輯
轉:用Spring快速開發jms應用(JBOSS服務器)
摘要: 異步進程通信是面向服務架構(SOA)一個重要的組成部分,因為企業里很多系統通信,特別是與外部組織間的通信,實質上都是異步的。Java消息服務(JMS)是用于編寫使用異步消息傳遞的JEE應用程序的API。傳統的使用JMS API進行消息傳遞的實現包括多個步驟,例如JNDI查詢隊列連接工廠和Queue資源,在實際發送和接收消息前創建一個JMS會話。
閱讀全文
posted @
2008-01-15 21:00 Ke 閱讀(2807) |
評論 (2) 編輯
在Servlet中調用spring中定義的Bean
摘要: WebApplicationContextUtils.getRequiredWebApplicationContext(getServletContext()).getBean("bookService");
閱讀全文
posted @
2007-11-25 13:42 Ke 閱讀(3017) |
評論 (2) 編輯