I have my backend servlet like following :

public class BackendServlet extends HttpServlet {

    private static final long serialVersionUID = 1L;

    private static final Logger LOG = Logger.getLogger(BackendServlet.class.getName());

    @Override protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException {

And then I put the Google verification html file into my project root folder. And I also use Google OAuth2 for the front end. Then I verify it using webmaster tools, but it's said:

Reverification failed. Your verification file redirects to a disallowed location

And so I tried the alternative method, by using the meta-tag. I included the meta-tag that given on the webmaster page into the BackendServlet class as following :

protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException {
    PrintWriter writer = resp.getWriter();
    writer.println("<!doctype html><html><head>");
    writer.println("<meta name=\"google-site-verification\" content=\"verification_string_here\" />");

Then again I verify it, but it still gave me an error like following :

Verification failed. We couldn't find the verification meta tag.

Would anyone be so kindly to tell me what I did wrong and what I should do to get my backend site got verified by Google Webmaster Tools?

  • These 2 methods require the site to be directly accessible on your domain over HTTP (port 80) - is that the case? Have you tried adding a TXT record in the domains DNS zone?
    – MrWhite
    Apr 6, 2014 at 11:31
  • Hi w3d, thanks for the reply. my site is hosted on google app engine server, so it's domain is backendname-dot-appname.appspot.com. How to add this TXT record to this backend domain in google app engine server? thanks. Apr 6, 2014 at 12:14
  • Ah, in that case I don't know whether it is possible to edit the DNS and add a TXT record - I would assume not. Maybe this question of StackOverflow can help: stackoverflow.com/questions/7030563/app-engine-webmaster-tools
    – MrWhite
    Apr 6, 2014 at 16:13
  • Thanks for the links. So is the verification of the site only need to be done one time? And after that I can just use this site without need to do any verification in the future? thanks. Apr 7, 2014 at 3:30
  • As far as GWT is concerned (whether this is different for app engine I don't know), the verification needs to be left in place as Google will periodically recheck this.
    – MrWhite
    Apr 7, 2014 at 7:04

1 Answer 1


Google app engine has documentation for static files. Treat your googleXXXXXXXXXXXX.html verification file as a static file:

By default, all files in the WAR are treated as both static files and resource files, except for JSP files

So just put that file into the root of your war file.

If for some reason you have configured HTML to be non-static, the documentation has XML snippets you can use to make the file static again:

    <include path="google*.html" />

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.