Dims
Dims

Reputation: 50999

How to access gwt:property properties from code?

For example, if I have

<meta name="gwt:property" content="variable=value"/> 

in my host HTML, how can I access it from java?

Upvotes: 4

Views: 1650

Answers (1)

Hilbrand Bouwkamp
Hilbrand Bouwkamp

Reputation: 13519

Not sure if you can get this specific meta directly, but with the following GWT code you can get the content:

    final NodeList<Element> metas = Document.get().getElementsByTagName("meta");

    for (int i = 0; i < metas.getLength(); i++) {
        final MetaElement m = MetaElement.as(metas.getItem(i));

        if ("gwt:property".equals(m.getName())) {
            //do something with content: m.getContent();
        }
    }

Upvotes: 5

Related Questions