Important Notice - Forums is archived
To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
reading config parameter from web.xml
Hi,
I am new to vaadin (and web programming in general), and am looking for a way to read a configured path from a config file. Searching on the internet seems to suggest the way to do this is use web.xml and store the parameter as an <init-param>, however my application doesn't seem to get the correct value
I am using the following entry in the web.xml:
<servlet>
<servlet-name>SimplevaadinserverUI</servlet-name>
<servlet-class>
com.vaadin.server.VaadinServlet
</servlet-class>
<init-param>
<param-name>configFilePath</param-name>
<param-value>/Path/To/XML/File.xml</param-value>
</init-param>
</servlet>
In the vaadin server application I have tried the following approaches:
1.
DeploymentConfiguration conf = getSession().getConfiguration();
String configFilePath = conf.getApplicationOrSystemProperty("configFilePath", "default/path/of/File.xml");
This always gives me the default, instead of the value in the xml that I am looking for.
2. String configFilePath = VaadinServlet.getCurrent().getInitParameter("configFilePath");
I get null for this.
Can anyone help with this?
Hi,
in my project i read from my web.xml like this:
String example = VaadinServlet.getCurrent().getServletContext().getInitParameter("example");
web.xml:
<context-param>
<param-name>example</param-name>
<param-value>myvalue</param-value>
</context-param>