Reputation: 3270
I was working with vaadin6 so i used the following method to retrive the web application parameters:
public abstract class Application implements URIHandler,
Terminal.ErrorListener, Serializable {
/**
* Searches for the property with the specified name in this application.
* This method returns <code>null</code> if the property is not found.
*
* See {@link #start(URL, Properties, ApplicationContext)} how properties
* are defined.
*
* @param name
* the name of the property.
* @return the value in this property list with the specified key value.
*/
public String getProperty(String name) {
return properties.getProperty(name);
}
//...
}
After migrating to vaadin7 i want to use the same functionnality but i couldn't find it.
Upvotes: 2
Views: 1155
Reputation: 4639
It seems you are looking for
VaadinServlet.getCurrent().getServletContext().getInitParameter("name");
It grants access to paramter defined in web.xml, for example:
<context-param>
<param-name>name</param-name>
<param-value>John</param-value>
</context-param>
Upvotes: 7