Home WeChat Applet Mini Program Development Sharing of graphic and text code for S2SH development applet

Sharing of graphic and text code for S2SH development applet

Apr 15, 2017 am 11:17 AM

1. Source code preparation:

1) struts2 source code:

a) struts-2.1.6-all.zip

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:

Sharing of graphic and text code for S2SH development applet

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

Session

InViewFilter 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 LazyLoad

Exception. b) To solve this problem, Spring introduced this Filter, which makes the life cycle

of Hibernate's Session longer.

c) Specific configuration:

<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>
Copy after login

3) Chinese

garbled code problem

:

a) Chinese garbled code problem, in struts.xml

Medium configuration:

<constant name="struts.i18n.encoding"  value="GB18030"  />
Copy after login
still cannot be solved.

b) This is a bug problem of strtust2.1.6. The solution is to use spring to provide encodingFilter implementation.

c) The specific configuration of 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> 
Copy after login

4) The order of filters in web.xml:

a) The filter with greater functionality in web.xml configuration The more worthy ones should be in the front.

b) Diagram of the filtering process of multiple filters:

As follows:

##5)

When uploading the Sharing of graphic and text code for S2SH development applet file Clear

cache

filter:

When uploading files, add the ActionContextCleanUp filter in web.xml. If it is not added, the file will not be retrieved for the first upload. Condition

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!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)