Загрузка класса во время выполнения из Struts 1.x в Spring MVC - PullRequest
0 голосов
/ 31 декабря 2018

У меня есть класс DispatcherServlet в Struts1.x, я должен перенести его из Struts 1.x в Spring MVC.У меня есть собственный класс DispatcherServelet, в котором мы записали файл свойств загрузки и сведения о подключении к БД, как показано ниже:

public class CemsActionServlet extends  ActionServlet {

public void init() throws ServletException{
        super.init();

            Util.load( getInitParameter( "prop_file" ));

            try{
                Util.keyValue(Constants.PH4_DB_USERID); 
                Util.keyValue(Constants.PH4_DB_PASSWORD);
               }catch(Exception e){
                 e.printStackTrace();
              }
            }

Я использовал PropertyPlaceHolderConfigurer, как показано ниже:

@Configuration
@PropertySource("classpath:/WebContent/prop/biuupload_cc.properties")

public class CemsBiuConfigurations {

    @Bean
    public static PropertySourcesPlaceholderConfigurer placeHolderConfigurer() {
        return new PropertySourcesPlaceholderConfigurer();
    }

}

}

Есть ли способ загрузить файл свойств, как описано выше в классе ActionServlet, в Spring MVC?

...