Using Guice with Cloud Endpoints FrameworksStay organized with collectionsSave and categorize content based on your preferences.
Google Guiceis a dependency injection framework that you can use with an
Endpoints Frameworks v2 project to configure servlet mapping and filtering
programmatically in Java, rather than inweb.xml.
To use Guice, you need to add the following prepackaged dependency to yourpom.xmlorbuild.gradle. Also, you need to configure the
Endpoints Frameworks plugins for Maven and Gradle to define which
service classes the plugins use to create OpenAPI documents.
The listener class creates a new injector that handles servlet mapping and
filtering, which is normally defined by theweb.xml, but instead is now
defined by the EchoEndpointModule class defined as:
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-12-15 UTC."],[],[]]