Summary Table

Categories Total Count
PII 0
URL 0
DNS 1
EKL 0
IP 0
PORT 0
VsID 0
CF 0
AI 0
VPD 0
PL 0
Other 0

File Content

package gov.va.med.ars.configuration.spring;

import javax.servlet.Filter;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.web.WebApplicationInitializer;
import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer;

import gov.va.med.ars.configuration.AppConfig;
import gov.va.med.ars.filter.CORSFilter;

/**
* @author
DNS
*
*/

public class SpringAppInitializer extends AbstractAnnotationConfigDispatcherServletInitializer implements WebApplicationInitializer{

@Override
protected Class<?>[] getRootConfigClasses() {
// TODO Auto-generated method stub
return new Class<?>[] {AppConfig.class};
}

// TBD - if the app does not work we need to add the WebMvcConfiguration
@Override
protected Class<?>[] getServletConfigClasses() {
// TODO Auto-generated method stub
return new Class<?>[] {SpringMvcConfig.class};
}

@Override
protected String[] getServletMappings() {
// TODO Auto-generated method stub
return new String[] {"/"};
}

@Override
protected Filter[] getServletFilters() {
return new Filter[] { new CORSFilter()};
}


@Autowired
private Environment env;

/* @Override
public void onStartup(ServletContext servletContext) throws ServletException {
super.onStartup(servletContext);
servletContext.setInitParameter("spring.profiles.active", env.getProperty("spring.profiles.active"));
System.out.println("Development profile has been set"+env.getProperty("spring.profiles.active"));
}*/
}