作者:ESC咻咻_973 | 来源:互联网 | 2023-09-05 21:33
IamworkingwithalegacySpringMVCrestfulorientedapplication(thatforlegalreasonscannotbe
I am working with a legacy Spring MVC restful oriented application (that for legal reasons cannot be upgrade easily) but I can't find a way to set initialization variables. These are static settings and properties that I can't set inside the web.xml (E.g. I could have used the servlet context variables).
我正在使用传统的Spring MVC restful介向应用程序(由于法律原因无法轻松升级)但我找不到设置初始化变量的方法。这些是我无法在web.xml中设置的静态设置和属性(例如,我可以使用servlet上下文变量)。
If I were using Spring 4.x and Servlet spec 3, I could use the 'WebApplicationInitializer' class but I can't use that with Spring 3.x and Servlet Spec 2.5. We are not using J2EE spec 3 either. What class or approaches could I use for initializing the web application. I was trying to avoid just using pure static variables.
如果我使用Spring 4.x和Servlet规范3,我可以使用'WebApplicationInitializer'类,但我不能将它与Spring 3.x和Servlet Spec 2.5一起使用。我们也没有使用J2EE规范3。我可以使用哪些类来初始化Web应用程序。我试图避免使用纯静态变量。
The goal is to set variables before any of the Spring beans are loaded.
目标是在加载任何Spring bean之前设置变量。
1 个解决方案