搜尋
首頁微信小程式小程式開發S2SH開發小程式的圖文程式碼分享

1.       源碼準備:

1)  struts2 源碼:

a)       struts-2.1.6-all.Np##. #b)      xwork-2.1.6.rar

c) ​​     jp.gr.java_conf.ussiy.app.propedit_5.3.3.zip,

e

S2SH開發小程式的圖文程式碼分享

#' se 管理資源檔案

2)  spring2.5 原始碼:

a) spring-framework-2.5.6.zip

#3)  hibernate3.2 來源碼:

a)       hibernate-distribution-3.3.2.GA-dist.zipS2SH開發小程式的圖文程式碼分享

b)      hibernate-annotations-3.4.0.GA.zip#> .zip

2.       SSH 所需要的 jar 包:1)  jar 包圖解:

# :######3.       所需注意的問題:######1)  @Scope(value=”propotype”)  所需注意的問題:######1)  @Scope(value=”propotype”)  所需注意的問題:######1)  @Scope(value=”propotype”)  所需注意的問題:######1)  @Scope(value=”propotype”)  所需注意的問題:######1)  @Scope(value=”propotype”) 問題######a)      # # 類,需要定義其類型為: propotype ,在類別上方加上:@Scope(value=”propotype”)######b)      如果不設置, spring 初始化的每個類,則預設 Scope值為 方式。然而 webWork 的Action 不是執行緒###安全###的,要求在多執行緒環境下必須是一個執行緒對應一個獨立的實例,不能使用singleton 。所以,我們在 Spring 配置 webWork Action Bean 時,需要加上###屬性###scope=”prototype” 或 singleton=”false” 。 #####2)  Open###Session###InViewFilter 相關問題:######a)       由於 Hibernate 引入了 Lazy Load ##如果再想透過 getter/load 方法取到其關聯物件的值, Hibernate 會拋出一個 LazyLoad 的###Exception### 。 ######b)      解決這個問題, Spring 引入了這個 Filter ,而使 Hibernate 的 Session 的###生命週期###變長。 ######c) ​​     特定設定:###
<filter> 
    <filter-name>openSessionInView</filter-name> 
    <filter-class>
org.springframework.orm.hibernate3.support.OpenSessionInViewFilter
    </filter-class>  
    <init-param> 
         <param-name>sessionFactoryBeanName</param-name> 
         <param-value>sf</param-value> 
    </init-param>
</filter> 
<filter-mapping> 
    <filter-name>openSessionInView</filter-name>      
    <url-pattern>/*</url-pattern> 
</filter-mapping>
###3)  中文###亂碼問題###:######a)       中文亂碼問題,並在「參考struts.#」 ## 中設定:###
<constant name="struts.i18n.encoding"  value="GB18030"  />
###仍然無法解決。 ######b)      此為 strtust2.1.6 的一個 bug 問題,且解決方法是使用 spring 提供 encodingFilter實現。 ######c) ​​     encodingFilter 具體設定:###
<filter>
	<filter-name>encodingFilter</filter-name>
	<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
	<init-param>
		<param-name>encoding</param-name>
		<param-value>GBK</param-value>
	</init-param>
</filter>
	
<filter-mapping>
	<filter-name>encodingFilter</filter-name>
	<url-pattern>/*</url-pattern>
</filter-mapping> 
###4) filter web.xml 中的順序問題:######a)   應該越配在前面。 ######b)   多個filter 在過濾過程圖解:######    如下:###############5)###上傳###檔案時###############5)###上傳###檔案時清除###快取###filter:###
<filter>
     <filter-name>struts-cleanup</filter-name>
     <filter-class>org.apache.struts2.dispatcher.ActionContextCleanUp</filter-class>
</filter>
<filter-mapping>
    <filter-name>struts-cleanup</filter-name>
     <url-pattern>/*</url-pattern>
</filter-mapping>
###在做上傳檔案的時候,要在web.xml中增加ActionContextCleanUp這個filter,如果不增加,會發生第一次上傳取不到檔案的情況###

以上是S2SH開發小程式的圖文程式碼分享的詳細內容。更多資訊請關注PHP中文網其他相關文章!

陳述
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn

熱AI工具

Undresser.AI Undress

Undresser.AI Undress

人工智慧驅動的應用程序,用於創建逼真的裸體照片

AI Clothes Remover

AI Clothes Remover

用於從照片中去除衣服的線上人工智慧工具。

Undress AI Tool

Undress AI Tool

免費脫衣圖片

Clothoff.io

Clothoff.io

AI脫衣器

Video Face Swap

Video Face Swap

使用我們完全免費的人工智慧換臉工具,輕鬆在任何影片中換臉!

熱工具

WebStorm Mac版

WebStorm Mac版

好用的JavaScript開發工具

SublimeText3 Linux新版

SublimeText3 Linux新版

SublimeText3 Linux最新版

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

這個專案正在遷移到osdn.net/projects/mingw的過程中,你可以繼續在那裡關注我們。 MinGW:GNU編譯器集合(GCC)的本機Windows移植版本,可自由分發的導入函式庫和用於建置本機Windows應用程式的頭檔;包括對MSVC執行時間的擴展,以支援C99功能。 MinGW的所有軟體都可以在64位元Windows平台上運作。

SublimeText3漢化版

SublimeText3漢化版

中文版,非常好用

SublimeText3 Mac版

SublimeText3 Mac版

神級程式碼編輯軟體(SublimeText3)