Make more robust against servlet-api being referenced in a resource class when not actually included on the classpath of the war.