[jetty-users] Run multiple instances of the same WAR servlet and pass it a config value

2023-10-04 Thread Alexander Farber via jetty-users
Good morning, I have an "overengineered" setup with Jetty 10.0.16 and haproxy 2.7.8, where I currently run 6 different Jetty instances to serve the same servlet - I have programmed that WAR servlet using Maven and it supports 6 languages: src/main/resources/strings.properties

Re: [jetty-users] Run multiple instances of the same WAR servlet and pass it a config value

2023-10-04 Thread Alexander Farber via jetty-users
I try to use the following but the method is not available: @Override public void init() throws ServletException { super.init(); mLanguage = getServletConfig().getContextPath(); } ___ jetty-users mailing list

Re: [jetty-users] Run multiple instances of the same WAR servlet and pass it a config value

2023-10-04 Thread Alexander Farber via jetty-users
Apologies, the getServletConfig().getContextPath() in the init() of my servlet works well, that probably had been a problem in my VS Code. Still I wonder, if I would set a "property" with a "name" and "value" as described in the "Jetty XML Syntax" section

Re: [jetty-users] Run multiple instances of the same WAR servlet and pass it a config value

2023-10-04 Thread Jan Bartel via jetty-users
You could call the method setInitParameter(String,String) via the context xml that defines the webapp, then you can retrieve it in the init() of your servlet via the ServletConfig.getInitParameter(String). Jan On Thu, 5 Oct 2023 at 06:42, Alexander Farber via jetty-users <

Re: [jetty-users] Run multiple instances of the same WAR servlet and pass it a config value

2023-10-04 Thread Joakim Erdfelt via jetty-users
In your /var/www/jetty-base-de/webapps/de.xml, you can set a init-parameter that can be accessed from the ServletContext.getInitParameter() Example: http://www.eclipse.org/jetty/configure_10_0.dtd;> /de /var/www/words-5.0.war