Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Module dtds not found #276

Open
branflake2267 opened this issue Aug 13, 2018 · 8 comments
Open

Module dtds not found #276

branflake2267 opened this issue Aug 13, 2018 · 8 comments

Comments

@branflake2267
Copy link
Contributor

Are the module dtd files on this site?

http://gwtproject.org/doctype/2.7.0/gwt-module.dtd

@TDesjardins
Copy link
Contributor

@branflake2267 The link is the official one but it seems that it is broken.

@TDesjardins
Copy link
Contributor

You will always get a HTTP 301 (Moved Permanently) response if you request a file other than html (which is true for dtd-files).
The cause for this issue is the server code of the gwt-site-webapp:

      if (!fullPath.endsWith("/")) {
        fullPath = fullPath + ".html";
        e = getResourceByKey(fullPath);
        if (e != null) {
          // redirect so we use correct urls!
          resp.setStatus(HttpServletResponse.SC_MOVED_PERMANENTLY);
          resp.setHeader("Location", "/" + fullPath);
          return;
        }
      }

So someone has to fix this code to solve this issue, but for repo 'gwt-site-webapp' it is not clear if contributions are welcome and the official code isn't hosted @ Github:

https://gwt.googlesource.com/gwt-site-webapp

@tbroyer
Copy link
Member

tbroyer commented May 1, 2020

Nope, this code is only triggered if the resource cannot be found in the data store. So if DTD links don't work, then it should mean they're not in the data store. Possibly a deployment problem then.

@tbroyer
Copy link
Member

tbroyer commented May 1, 2020

Their hashes are in the DocHash collection: http://www.gwtproject.org/hash?count=0, that probably means they'll never going to be uploaded again, so if they're missing in the actual document store then redeploying the site won't fix it.

@TDesjardins
Copy link
Contributor

Nope, this code is only triggered if the resource cannot be found in the data store. So if DTD links don't work, then it should mean they're not in the data store. Possibly a deployment problem then.

I suppose you are wrong. Have a look at this point in the code:

fullPath = fullPath + ".html";

For all paths the String ".html" is added before searching in the datastore. This ends up in the following I think when searching for dtd file: "doctype/2.7.0/gwt-module.dtd.html" which of course can't be found.

@tbroyer
Copy link
Member

tbroyer commented May 1, 2020

You omitted the lines just above 😉

String fullPath = normalizePath(req.getRequestURI());

Entity e = getResourceByKey(fullPath);

if (e == null) {
  // temporary try to find the resource with .html appended
  // due to redirects from developers.google.com

@TDesjardins
Copy link
Contributor

Hm, right! The classic if-cascade. Whatever happened here it ends in a HTTP 301:

moved-301

Don't know if the code alone can explain this behaviour.

@TDesjardins
Copy link
Contributor

If you use these links it works:

http://www.gwtproject.org/doctype/2.7.0/gwt-module.dtd
http://www.gwtproject.org/doctype/2.8.2/gwt-module.dtd

comparing to these which redirect to gwt-project page:

http://gwtproject.org/doctype/2.7.0/gwt-module.dtd
http://gwtproject.org/doctype/2.8.2/gwt-module.dtd

Ommitting 'www' will break the links.

Don't know if this knowledge is sufficiant to close this issue. In my opinion it should also work without 'www'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants