appengine-java-standard icon indicating copy to clipboard operation
appengine-java-standard copied to clipboard

Confusion with Servlets defined in AppEngineWebAppContext

Open joakime opened this issue 3 years ago • 3 comments
trafficstars

There appears to be some confusion about the Servlets defined in runtime/impl/src/main/java/com/google/apphosting/runtime/jetty94/AppEngineWebAppContext.java

We have a section of code that attempts to remove deprecated Servlets and then ensure that some Servlets are added ...

https://github.com/GoogleCloudPlatform/appengine-java-standard/blob/main/runtime/impl/src/main/java/com/google/apphosting/runtime/jetty94/AppEngineWebAppContext.java#L225-L256

https://github.com/GoogleCloudPlatform/appengine-java-standard/blob/bcb69c04b532da33c11da826a00657ced2b0b670/runtime/impl/src/main/java/com/google/apphosting/runtime/jetty94/AppEngineWebAppContext.java#L225-L256

But the listed DEPRECATED_SERVLETS_FILTERS appear to be the same ones being added (ensure) back to the WebAppContext.

https://github.com/GoogleCloudPlatform/appengine-java-standard/blob/main/runtime/impl/src/main/java/com/google/apphosting/runtime/jetty94/AppEngineWebAppContext.java#L97-L118

https://github.com/GoogleCloudPlatform/appengine-java-standard/blob/bcb69c04b532da33c11da826a00657ced2b0b670/runtime/impl/src/main/java/com/google/apphosting/runtime/jetty94/AppEngineWebAppContext.java#L97-L118

Is that what you want to do?

If that entire section was removed and simply defined within a custom webdefault.xml, and specified in the AppEngineWebAppContext.setDefaultDescriptor(String) then all of those servlets will be added and flagged with mapping.isDefault = true allowing them to be overridden by the deployed webapps.

joakime avatar Jul 31 '22 13:07 joakime

I think yes! We need to support web apps deployed in 2015 or even before and those were relying on ancient defaultweb.xml so this complex logic tried to handle this use case so that old apps could still be loaded with latest runtime,

ludoch avatar Jul 31 '22 13:07 ludoch

@gregw will have more context but the intention was to handle very old deployments with the new jetty94 bits.

ludoch avatar Jul 31 '22 13:07 ludoch

(Remember that we generate the quickstart web.xml that contains all the app servlets plus the server ones... So old apps would have a quickstart-web.xml with ancient content of ancient webdefault.xml even if we deleted or changed those internal servlets.

ludoch avatar Jul 31 '22 13:07 ludoch

Closing as we do not thing it is a critical issue.

ludoch avatar May 09 '23 20:05 ludoch