Skip to content

Instantly share code, notes, and snippets.

# This config file is processed on servlet initialization to activate profile for spring application context
spring.profiles.active=${spring.profiles.active}
public class WebAppInitializer implements WebApplicationInitializer {
private static final Logger logger = LoggerFactory.getLogger(WebAppInitializer.class);
public static final String PROFILE_CONFIG_FILE = "/config/profile.config";
@Override
public void onStartup(ServletContext servletContext) throws ServletException {
try {
// Access profile config file for active profile
Properties properties = new Properties();
...
<profiles>
<profile>
<id>production</id>
<properties>
<spring.profiles.active>production</spring.profiles.active>
</properties>
</profile>
<profile>
<id>development</id>
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0">
...
<context-param>
${spring.profiles.active}
</context-param>
...
@iesen
iesen / svn-4
Created December 19, 2013 11:58
$ svn commit --changelist myChangelist
@iesen
iesen / svn-3
Created December 19, 2013 11:57
$ svn changelist myChangelist --remove ExperimentalClassNotReadyForCommit.java
@iesen
iesen / svn-2
Created December 19, 2013 11:56
$ svn changelist myChangelist -R .
@iesen
iesen / svn-1
Last active December 31, 2015 20:09
$ svn status
M file1
M resources/resim.png
A MyBean.java
....
M ExperimentalClassNotReadyForCommit.java
vim ~/.bash_profile
alias ll='ls -lGaf'