This commit is contained in:
anhefti 2019-09-04 13:23:33 +02:00
parent 00a51bbb3f
commit 7702a6649c
5 changed files with 13 additions and 3 deletions

View file

@ -4,7 +4,7 @@ server.port=8080
server.servlet.context-path=/ server.servlet.context-path=/
server.servlet.session.cookie.http-only=true server.servlet.session.cookie.http-only=true
server.servlet.session.tracking-modes=cookie server.servlet.session.tracking-modes=cookie
spring.messages.basename=messages,file:/sebserver/messagess spring.messages.basename=file:/sebserver/messages
# database server # database server
datastore.mariadb.server.address=seb-server-mariadb datastore.mariadb.server.address=seb-server-mariadb

View file

@ -26,8 +26,8 @@ services:
- INTERNAL_PWD=somePW - INTERNAL_PWD=somePW
volumes: volumes:
- ./application-demo.properties:/sebserver/application-demo.properties - ./application-demo.properties:/sebserver/application-demo.properties
- ./messagess_en.properties:/sebserver/messagess_en.properties - ./messages_en.properties:/sebserver/messages_en.properties
- ./messagess.properties:/sebserver/messagess.properties - ./messages.properties:/sebserver/messages.properties
ports: ports:
- 8080:8080 - 8080:8080
- 9090:9090 - 9090:9090

View file

@ -0,0 +1 @@

View file

@ -15,11 +15,14 @@ import javax.servlet.ServletException;
import org.eclipse.rap.rwt.engine.RWTServlet; import org.eclipse.rap.rwt.engine.RWTServlet;
import org.eclipse.rap.rwt.engine.RWTServletContextListener; import org.eclipse.rap.rwt.engine.RWTServletContextListener;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.web.servlet.ServletContextInitializer; import org.springframework.boot.web.servlet.ServletContextInitializer;
import org.springframework.boot.web.servlet.ServletListenerRegistrationBean; import org.springframework.boot.web.servlet.ServletListenerRegistrationBean;
import org.springframework.boot.web.servlet.ServletRegistrationBean; import org.springframework.boot.web.servlet.ServletRegistrationBean;
import org.springframework.context.MessageSource;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.context.support.ReloadableResourceBundleMessageSource;
import ch.ethz.seb.sebserver.gbl.profile.GuiProfile; import ch.ethz.seb.sebserver.gbl.profile.GuiProfile;
@ -48,6 +51,12 @@ public class RAPSpringConfig {
return new ServletRegistrationBean<>(new RWTServlet(), this.entrypoint + "/*"); return new ServletRegistrationBean<>(new RWTServlet(), this.entrypoint + "/*");
} }
@Bean
@ConfigurationProperties("spring.messages")
public MessageSource messageSource() {
return new ReloadableResourceBundleMessageSource();
}
private static class RAPServletContextInitializer implements ServletContextInitializer { private static class RAPServletContextInitializer implements ServletContextInitializer {
@Override @Override
public void onStartup(final ServletContext servletContext) throws ServletException { public void onStartup(final ServletContext servletContext) throws ServletException {