[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-09-04。"],[[["\u003cp\u003eThis guide outlines the essential files needed to use Cloud Endpoints Frameworks for App Engine, including the API class file, \u003ccode\u003eappengine-web.xml\u003c/code\u003e, and \u003ccode\u003eweb.xml\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe API class file, located at \u003ccode\u003e/src/main/java/<packagepath>/<your_api_class>.java\u003c/code\u003e, houses your backend API code, potentially spread across multiple classes.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eappengine-web.xml\u003c/code\u003e, found in \u003ccode\u003e/src/main/webapp/WEB-INF/\u003c/code\u003e, is crucial for defining App Engine's standard environment configurations, with minimum required contents being the runtime, threadsafe, and system properties tags.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eweb.xml\u003c/code\u003e, also in \u003ccode\u003e/src/main/webapp/WEB-INF/\u003c/code\u003e, configures the Endpoints servlet to handle incoming API requests and forward them to the App Engine backend, and it is a requirement to manage your API through Cloud Endpoints.\u003c/p\u003e\n"],["\u003cp\u003eThe URL pattern in the \u003ccode\u003eweb.xml\u003c/code\u003e file defines the URL base path for your API, and it must end with a wildcard, as demonstrated by \u003ccode\u003e/_ah/api/*\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,["# Required Files and Configuration\n\nThis page describes the files that must be included in API in order to use Cloud Endpoints Frameworks for App Engine.\n\nYour project must contain, at a minimum, the following files:\n\n\nThe contents of each of these required files is documented in the following\nsections.\n\nThe API class file\n------------------\n\nThe required and optional contents of the class file (or files, if you use a\n[multi-class API](/endpoints/docs/frameworks/java/multiclass)) are fully described\nin the topic [Endpoint Annotations](/endpoints/docs/frameworks/java/annotations).\n\nappengine-web.xml\n-----------------\n\nThe `appengine-web.xml` file is used to define the App Engine standard\nenvironment configuration when the API is deployed.\nSee [appengine-web.xml Reference](/appengine/docs/standard/java/config/appref)\nfor more information.\n\nThe bare minimum contents required for this file are as follows: \n\n \u003cappengine-web-app xmlns=\"http://appengine.google.com/ns/1.0\"\u003e\n \u003cruntime\u003ejava8\u003c/runtime\u003e\n \u003cthreadsafe\u003etrue\u003c/threadsafe\u003e\n\n \u003csystem-properties\u003e\n \u003cproperty name=\"java.util.logging.config.file\" value=\"WEB-INF/logging.properties\"/\u003e\n \u003c/system-properties\u003e\n \u003c/appengine-web-app\u003e\n\nweb.xml\n-------\n\nYou use the `web.xml` file to configure the Endpoints servlet, which handles\nincoming requests and forwards them to the backend service running on\nApp Engine. The Endpoints servlet is required for your API to be\n[managed by Cloud Endpoints](/endpoints/docs/frameworks/java/adding-api-management).\n\nThe bare minimum contents required for this file are as follows: \n\n \u003cweb-app xmlns=\"http://xmlns.jcp.org/xml/ns/javaee\"\n xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n xsi:schemaLocation=\"http://xmlns.jcp.org/xml/ns/javaee\n http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd\"\n version=\"3.1\"\u003e\n \u003c!-- Wrap the backend with Endpoints Frameworks v2. --\u003e\n \u003cservlet\u003e\n \u003cservlet-name\u003eEndpointsServlet\u003c/servlet-name\u003e\n \u003cservlet-class\u003ecom.google.api.server.spi.EndpointsServlet\u003c/servlet-class\u003e\n \u003cinit-param\u003e\n \u003cparam-name\u003eservices\u003c/param-name\u003e\n \u003cparam-value\u003ecom.example.skeleton.MyApi\u003c/param-value\u003e\n \u003c/init-param\u003e\n \u003c/servlet\u003e\n \u003c!-- Route API method requests to the backend. --\u003e\n \u003cservlet-mapping\u003e\n \u003cservlet-name\u003eEndpointsServlet\u003c/servlet-name\u003e\n \u003curl-pattern\u003e/_ah/api/*\u003c/url-pattern\u003e\n \u003c/servlet-mapping\u003e\n \u003c/web-app\u003e\n\n| **Important:** The URL pattern specified in the `web.xml` file defines the URL base path for the API. Make sure the pattern ends with a wildcard, as in `/_ah/api/*`.\n\nFor more information about `web.xml`, see\n[The Deployment Descriptor: web.xml](/appengine/docs/standard/java/config/webxml)."]]