Write a configuration file specifically to store all the global variables you need, and construct a method to dynamically read the configuration, which can be directly introduced by the frontend. (an idea)
Spring itself can configure similar global variables in xml, such as configuring fixed variables in ./application.propertites and then reading them
Your problem should be related to the forwarding of URL mapping from the internal network to the external network. Configure it on the public network machine
In the final analysis, it is caused by the name of the project, so just leave the project as it iswebApps->ROOT 下 文件夹名字大写,就不需要项目名了。 引入css以及js直接 就 / Okay
Is this how to access the intranet
http://192.168.1.1/rs
,外网是这么访问的:http://61.11.11.11:1002/project/rs
?I don’t quite understand the issue of reverse proxy, but wouldn’t it be enough if you make the paths for the internal and external networks the same?
Create a new configure.properties file under the classpath with the following content:
Then configure the following xml fragment in spring-mvc-servlet.xml. Note that it must be in the spring mvc configuration file.
Then use @Value in the controller to inject the configured value
This has nothing to do with the global situation. This value should be obtained by yourself, not set by you,
Threadlocal can be tried
Write a configuration file specifically to store all the global variables you need, and construct a method to dynamically read the configuration, which can be directly introduced by the frontend. (an idea)
Spring itself can configure similar global variables in xml, such as configuring fixed variables in ./application.propertites and then reading them
Your problem should be related to the forwarding of URL mapping from the internal network to the external network. Configure it on the public network machine
In the final analysis, it is caused by the name of the project, so just leave the project as it is
webApps->ROOT
下 文件夹名字大写,就不需要项目名了。引入
css
以及js
直接 就/
Okay