首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >将参数传递给vaadin 7 web应用程序

将参数传递给vaadin 7 web应用程序
EN

Stack Overflow用户
提问于 2013-12-25 16:57:03
回答 1查看 1.1K关注 0票数 2

我使用的是vaadin6,所以我使用了以下方法来检索web应用程序参数:

代码语言:javascript
复制
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);
    }

    //...
}

迁移到vaadin7之后,我想使用相同的功能,但是我找不到它。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-12-25 17:22:01

看来你是在找

代码语言:javascript
复制
VaadinServlet.getCurrent().getServletContext().getInitParameter("name");

它允许访问web.xml中定义的参数,例如:

代码语言:javascript
复制
<context-param>
  <param-name>name</param-name>
  <param-value>John</param-value>
</context-param>
票数 7
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/20774980

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档