Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
gjjapp
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhfwpt
gjjapp
Commits
7606b694
Commit
7606b694
authored
Jun 03, 2026
by
张俊
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
升级tomcat版本改造
parent
f6a2cb52
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
71 additions
and
56 deletions
+71
-56
gjjapp-web/src/main/java/com/changda/gjjapp/encryptor/EncryptController.java
.../java/com/changda/gjjapp/encryptor/EncryptController.java
+1
-1
gjjapp-web/src/main/java/com/changda/gjjapp/encryptor/EncryptorConfig.java
...in/java/com/changda/gjjapp/encryptor/EncryptorConfig.java
+31
-15
gjjapp-web/src/main/resources/gjj.properties
gjjapp-web/src/main/resources/gjj.properties
+6
-6
gjjapp-web/src/main/resources/spring-context.xml
gjjapp-web/src/main/resources/spring-context.xml
+3
-4
pom.xml
pom.xml
+30
-30
No files found.
gjjapp-web/src/main/java/com/changda/gjjapp/encryptor/EncryptController.java
View file @
7606b694
...
...
@@ -12,7 +12,7 @@ import org.springframework.stereotype.Controller;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.ResponseBody
;
@Controller
()
@Controller
@RequestMapping
(
value
=
"/encrypt"
)
public
class
EncryptController
{
...
...
gjjapp-web/src/main/java/com/changda/gjjapp/encryptor/EncryptorConfig.java
View file @
7606b694
...
...
@@ -3,8 +3,6 @@ package com.changda.gjjapp.encryptor;
import
org.jasypt.encryption.StringEncryptor
;
import
org.jasypt.encryption.pbe.PooledPBEStringEncryptor
;
import
org.jasypt.encryption.pbe.StandardPBEByteEncryptor
;
import
org.jasypt.encryption.pbe.StandardPBEStringEncryptor
;
import
org.jasypt.encryption.pbe.config.EnvironmentStringPBEConfig
;
import
org.jasypt.encryption.pbe.config.SimpleStringPBEConfig
;
import
org.jasypt.spring4.properties.EncryptablePropertyPlaceholderConfigurer
;
import
org.springframework.context.annotation.Bean
;
...
...
@@ -14,21 +12,40 @@ import org.springframework.core.io.DefaultResourceLoader;
@Configuration
public
class
EncryptorConfig
{
/*@Bean
public StandardPBEStringEncryptor standardPBEStringEncryptor() {
EnvironmentStringPBEConfig stringPBEConfig = new EnvironmentStringPBEConfig();
stringPBEConfig.setAlgorithm("PBEWithMD5AndDES");
stringPBEConfig.setPassword("root");
StandardPBEStringEncryptor pbeStringEncryptor = new StandardPBEStringEncryptor();
pbeStringEncryptor.setConfig(stringPBEConfig);
return pbeStringEncryptor;
}*/
/**
* 必须为 static 方法,确保 BeanFactoryPostProcessor 最先被 Spring 创建,
* 且不依赖其他 Bean(如 StringEncryptor),避免循环依赖导致占位符未被解析。
* 同时加载 gjj.properties 和 gjj_bussiness.property,确保所有 ${...} 占位符都能被解析。
*/
@Bean
public
EncryptablePropertyPlaceholderConfigurer
propertyConfigurer
(
StringEncryptor
pbeStringEncryptor
)
{
EncryptablePropertyPlaceholderConfigurer
placeholderConfigurer
=
new
EncryptablePropertyPlaceholderConfigurer
(
pbeStringEncryptor
);
public
static
EncryptablePropertyPlaceholderConfigurer
propertyConfigurer
()
{
PooledPBEStringEncryptor
encryptor
=
new
PooledPBEStringEncryptor
();
SimpleStringPBEConfig
config
=
new
SimpleStringPBEConfig
();
// 加密盐值
config
.
setPassword
(
"gjjcdgs856177110"
);
// 加密算法
config
.
setAlgorithm
(
StandardPBEByteEncryptor
.
DEFAULT_ALGORITHM
);
// key迭代次数
config
.
setKeyObtentionIterations
(
"1000"
);
// 池大小
config
.
setPoolSize
(
"1"
);
config
.
setProviderName
(
"SunJCE"
);
// 随机盐生成器
config
.
setSaltGeneratorClassName
(
"org.jasypt.salt.RandomSaltGenerator"
);
config
.
setIvGeneratorClassName
(
"org.jasypt.iv.RandomIvGenerator"
);
// 加密后输出字符串编码方式
config
.
setStringOutputType
(
"base64"
);
encryptor
.
setConfig
(
config
);
EncryptablePropertyPlaceholderConfigurer
placeholderConfigurer
=
new
EncryptablePropertyPlaceholderConfigurer
(
encryptor
);
DefaultResourceLoader
defaultResourceLoader
=
new
DefaultResourceLoader
();
placeholderConfigurer
.
setLocations
(
defaultResourceLoader
.
getResource
(
"classpath:gjj.properties"
));
// 加载两个配置文件,确保 gjj.properties 中的 jdbc.* 属性和 gjj_bussiness.property 中的业务属性都能被解析
placeholderConfigurer
.
setLocations
(
defaultResourceLoader
.
getResource
(
"classpath:gjj.properties"
),
defaultResourceLoader
.
getResource
(
"classpath:gjj_bussiness.property"
)
);
// 不忽略无法解析的占位符,发现问题更早暴露
placeholderConfigurer
.
setIgnoreUnresolvablePlaceholders
(
false
);
return
placeholderConfigurer
;
}
...
...
@@ -55,5 +72,4 @@ public class EncryptorConfig {
}
}
gjjapp-web/src/main/resources/gjj.properties
View file @
7606b694
...
...
@@ -15,15 +15,15 @@ FileTemplatPath=D:\\JavaFileDir
jdbc.type
=
oracle
jdbc.driver
=
oracle.jdbc.driver.OracleDriver
jdbc.url
=
ENC(O/MRgz1LcC4g+4JLVPeEEQYSJQ8MNNvUJ6ri4Izl5IdK1NEkMhRvmi+54sNI/HmoOOxZpcZY/64vTaXZvKBNQg==)
jdbc.username
=
GJJ
80
jdbc.password
=
GJJ
80_Hg41RG
jdbc.url
=
jdbc:oracle:thin:@192.168.101.196:1521:zfgjj
jdbc.username
=
ZHFW
80
jdbc.password
=
ZHFW
80_Hg41RG
jdbc.type.ss
=
oracle
jdbc.driver.ss
=
oracle.jdbc.driver.OracleDriver
jdbc.url.ss
=
ENC(O/MRgz1LcC4g+4JLVPeEEQYSJQ8MNNvUJ6ri4Izl5IdK1NEkMhRvmi+54sNI/HmoOOxZpcZY/64vTaXZvKBNQg==)
jdbc.username.ss
=
GJJ
80
jdbc.password.ss
=
GJJ
80_Hg41RG
jdbc.url.ss
=
jdbc:oracle:thin:@192.168.101.196:1521:zfgjj
jdbc.username.ss
=
ZHFW
80
jdbc.password.ss
=
ZHFW
80_Hg41RG
#jdbc.type=oracle
#jdbc.driver=oracle.jdbc.driver.OracleDriver
...
...
gjjapp-web/src/main/resources/spring-context.xml
View file @
7606b694
...
...
@@ -28,7 +28,7 @@
</aop:aspectj-autoproxy>
<!-- 加载配置属性文件 -->
<!--<context:property-placeholder ignore-unresolvable="true" location="classpath:gjj.properties" />-->
<
context:property-placeholder
ignore-unresolvable=
"true"
location=
"classpath:gjj_bussiness.property"
/
>
<
!--<context:property-placeholder ignore-unresolvable="true" location="classpath:gjj_bussiness.property" />--
>
<!-- 加载应用属性实例,可通过 @Value("#{APP_PROP['jdbc.driver']}") String jdbcDriver
方式引用 -->
...
...
@@ -56,9 +56,8 @@
<!-- MyBatis begin -->
<bean
id=
"sqlSessionFactory"
class=
"org.mybatis.spring.SqlSessionFactoryBean"
>
<property
name=
"dataSource"
ref=
"dataSource"
/>
<property
name=
"typeAliasesPackage"
value=
"com.changda"
/>
<property
name=
"typeAliasesSuperType"
value=
"com.changda.cd4j.foundation.core.persistence.BaseEntity"
/>
<property
name=
"typeAliasesPackage"
value=
"com.changda.**.entity"
/>
<property
name=
"typeAliasesSuperType"
value=
"com.changda.cd4j.foundation.core.persistence.BaseEntity"
/>
<property
name=
"mapperLocations"
value=
"classpath*:/mappings/**/*.xml"
/>
<property
name=
"configLocation"
value=
"classpath:/mybatis-config.xml"
></property>
</bean>
...
...
pom.xml
View file @
7606b694
...
...
@@ -121,18 +121,18 @@
<activiti.version>
5.22.0
</activiti.version>
</properties>
<repositories
>
<repository
>
<id>
nexus-central
</id
>
<name>
Central
</name
>
<url>
http://192.168.101.124:8889/nexus/content/repositories/central/
</url
>
</repository
>
<repository
>
<id>
nexus-repos
</id
>
<name>
Team Nexus Repository
</name
>
<url>
http://192.168.101.124:8889/nexus/content/repositories/thirdparty
</url
>
</repository
>
</repositories
>
<!-- <repositories>--
>
<!-- <repository>--
>
<!-- <id>nexus-central</id>--
>
<!-- <name>Central</name>--
>
<!-- <url>http://192.168.101.124:8889/nexus/content/repositories/central/</url>--
>
<!-- </repository>--
>
<!-- <repository>--
>
<!-- <id>nexus-repos</id>--
>
<!-- <name>Team Nexus Repository</name>--
>
<!-- <url>http://192.168.101.124:8889/nexus/content/repositories/thirdparty</url>--
>
<!-- </repository>--
>
<!-- </repositories>--
>
<dependencyManagement>
<dependencies>
...
...
@@ -812,17 +812,17 @@
<distributionManagement
>
<snapshotRepository
>
<id>
nexus-snapshots
</id
>
<name>
nexus distribution snapshot repository
</name
>
<url>
http://192.168.101.124:8889/nexus/content/repositories/snapshots/
</url
>
</snapshotRepository
>
<repository
>
<id>
nexus-3rd
</id
>
<url>
http://192.168.101.124:8889/nexus/content/repositories/thirdparty/
</url
>
</repository
>
</distributionManagement
>
<!-- <distributionManagement>--
>
<!-- <snapshotRepository>--
>
<!-- <id>nexus-snapshots</id>--
>
<!-- <name>nexus distribution snapshot repository</name>--
>
<!-- <url>http://192.168.101.124:8889/nexus/content/repositories/snapshots/</url>--
>
<!-- </snapshotRepository>--
>
<!-- <repository>--
>
<!-- <id>nexus-3rd</id>--
>
<!-- <url>http://192.168.101.124:8889/nexus/content/repositories/thirdparty/</url>--
>
<!-- </repository>--
>
<!-- </distributionManagement>--
>
<build>
...
...
@@ -834,9 +834,9 @@
<artifactId>
maven-resources-plugin
</artifactId>
<version>
2.6
</version>
<configuration>
<source>
${java.version}
</source>
<
!--<
source>${java.version}</source>
<target>${java.version}</target>
<showWarnings>
true
</showWarnings>
<showWarnings>true</showWarnings>
-->
<encoding>
UTF-8
</encoding>
</configuration>
</plugin>
...
...
@@ -856,10 +856,10 @@
<artifactId>
maven-deploy-plugin
</artifactId>
<version>
2.6
</version>
<configuration>
<source>
${java.version}
</source>
<!--
<source>${java.version}</source>
<target>${java.version}</target>
<showWarnings>true</showWarnings>
<encoding>
UTF-8
</encoding>
<encoding>UTF-8</encoding>
-->
</configuration>
</plugin>
<plugin>
...
...
@@ -901,10 +901,10 @@
</developer>
</developers>
<modules>
<module>
gjjapp-web
</module>
<module>
gjjapp-common
</module>
<module>
gjjapp-db
</module>
<module>
gjjapp-gedai
</module>
<module>
gjjapp-zhfwpt
</module>
<module>
gjjapp-db
</module>
<module>
gjjapp-common
</module>
<module>
gjjapp-web
</module>
</modules>
</project>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment