Default profile in Spring 3.1

Define your production environment as default profile in your web.xml <context-param> <param-name>spring.profiles.default</param-name> <param-value>prod</param-value> </context-param> and if you want to use a different profile pass it as system property mvn -Dspring.profiles.active=”demo” jetty:run

How to set active spring 3.1 environment profile via a properites file and not via an env variable or system property

In web.xml <context-param> <param-name>spring.profiles.active</param-name> <param-value>profileName</param-value> </context-param> Using WebApplicationInitializer This approach is used when you don’t have a web.xml file in Servlet 3.0 environment and are bootstrapping the Spring completely from Java: class SpringInitializer extends WebApplicationInitializer { void onStartup(ServletContext container) { AnnotationConfigWebApplicationContext rootContext = new AnnotationConfigWebApplicationContext(); rootContext.getEnvironment().setActiveProfiles(“profileName”); rootContext.register(SpringConfiguration.class); container.addListener(new ContextLoaderListener(rootContext)); } } Where SpringConfiguration class is … Read more

Create folder and file on Current user profile, from Admin Profile

Cross-Reference: A related issue is when you have a settings file that regular users can’t write to. This is a list of approaches for eliminating that condition: System.UnauthorizedAccessException while running .exe under program files. Install two mutually-exclusive files with the same name to the same directory I will just summarize what others have basically mentioned, … Read more