1. Source code preparation:
1) struts2 source code:
b) xwork-2.1.6.rar
c) jp.gr.java_conf.ussiy.app.propedit_5.3.3.zip,eclip se management resource file
2) spring2.5 source code:
a) spring-framework-2.5.6.zip
3) hibernate3.2 source code:
a) hibernate-distribution-3.3.2.GA-dist.zip
b) hibernate-annotations-3.4.0.GA.zip
c) slf4j-1.5.8 .zip
2. The jar package required for SSH:
1) Jar package illustration:
2) Jar package related instructions :
3. Issues that need attention:
1) @Scope(value=”propotype”) Question
a) Each defined action Class, you need to define its type as: prototype, add on the class: @Scope(value="propotype")
b) If not set, for each class initialized by spring, the default Scope value is singleton Way. However, webWork's Action is not thread-safe. It requires that one thread corresponds to an independent instance in a multi-threaded environment, and singleton cannot be used. Therefore, when we configure the webWork Action Bean in Spring, we need to add the attributescope=”prototype” or singleton=”false”. 2) Open
SessionInViewFilter related issues: a) Since Hibernate introduced the Lazy Load feature (), it makes the
object# out of Hibernate's Session cycle ##If you want to get the value of its associated object through the getter/load method, Hibernate will throw a LazyLoadException. b) To solve this problem, Spring introduced this Filter, which makes the life cycle
of Hibernate's Session longer.<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>
garbled code problem
:a) Chinese garbled code problem, in struts.xml
Medium configuration:<constant name="struts.i18n.encoding" value="GB18030" />
<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>
When uploading the file Clear
cachefilter:<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>
The above is the detailed content of Sharing of graphic and text code for S2SH development applet. For more information, please follow other related articles on the PHP Chinese website!