how to add meta tag in the header's page [with uibinder ?]

476 views
Skip to first unread message

Axel REGNOULT

unread,
Dec 19, 2012, 12:05:52 PM12/19/12
to google-we...@googlegroups.com
Hello,

I know how to change meta tags in my main html page (the one that does a call to the gwt's bootstrap script)...

But I do not know how could I add the <meta name="robots" content="noindex"> in the header of my "error page".

Any solution including uibinder would be interesting.
Thanks you,


Matthew Dempsky

unread,
Dec 19, 2012, 12:10:20 PM12/19/12
to google-web-toolkit
What error page are you referring to?  Do you mean the 404 or 502 errors returned by your web server?  If so, I don't think GWT or UiBinder has anything to do with that, and you just need to add the <meta> tag to whatever file your web server is configured to serve for those errors.

If you mean something else, please clarify.




--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/0Sf9PQUIcxEJ.
To post to this group, send email to google-we...@googlegroups.com.
To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

Axel REGNOULT

unread,
Dec 19, 2012, 3:27:40 PM12/19/12
to google-we...@googlegroups.com
Ok, I mean that my site has some pages 'under construction'. For example, if you click on the 'foto menu' so I will not show www.mysite/foto but www.mysite/error...(my error page explains that my site is under construction but I do not want this page indexed or referenced by the google search).

I have used webmaster tool to remove this url from google search, but in a more general way, I would like to properly indicate the meta tag NO FOLLOW.

And to generalize a little more my problem, let s imagine that I have to add other meta tag (schema.org..., or the description/keywords of my page)...so what is the code to add these meta tag in the header ?

Thanks you,




Benjamin Possolo

unread,
Dec 31, 2012, 5:07:41 AM12/31/12
to google-we...@googlegroups.com
Here is an example for setting the description meta element

public static void setMetaDescription(String description){

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

for( int i = 0; i < nodes.getLength(); i++ ){

MetaElement meta = (MetaElement)nodes.getItem(i);

if( "description".equals(meta.getName()) ){

meta.setContent(description);

break;

}

}

}

Reply all
Reply to author
Forward
0 new messages