ID is an abbreviated code that Google assigns based on the region you select when you create your app. The code does not correspond to a country or province, even though some region IDs may appear similar to commonly used country and province codes. ID.r is included in App Engine URLs. For existing apps created before this date, the region ID is optional in the URL. Learn more about region IDs. Java web applications use a deployment descriptor file to determine how URLs map to servlets, which URLs require authentication, and other information. This file is named web.xml, and resides in the app's WAR under the WEB-INF/ directory. For more information about the web.xml standard, see the the Servlet specification. A web application's deployment descriptor describes the classes, resources and configuration of the application and how the web server uses them to serve web requests. When the web server receives a request for the application, it uses the deployment descriptor to map the URL of the request to the code that ought to handle the request.
The deployment descriptor is a file named web.xml. It resides in the app's WAR under the WEB-INF/ directory. The file is an XML file whose root element is . URL paths and the servlets that handle requests with those paths. The web server uses this configuration to identify the servlet to handle a given request and call the class method that corresponds to the request method. For example: the doGet() method for HTTP GET requests. To map a URL to a servlet, you declare the servlet with the element, then define a mapping from a URL path to a servlet declaration with the element. The element declares the servlet, including a name used to refer to the servlet by other elements in the file, the class to use for the servlet, and initialization parameters. You can declare multiple servlets using the same class with different initialization parameters. The name for each servlet must be unique across the deployment descriptor. The element specifies a URL pattern and the name of a declared servlet to use for requests whose URL matches the pattern.
The standard does not support wildcards in the middle of a string, and does not allow multiple wildcards in one pattern. The pattern matches the full path of the URL, starting with and including the forward slash (/) following the domain name. The URL path cannot start with a period (.). 0000CC. The servlet can get the portion of the URL path matched by the wildcard using the ServletRequest object's getPathInfo() method. The servlet can access its initialization parameters by getting its servlet configuration using its own getServletConfig() method, then calling the getInitParameter() method on the configuration object using the name of the parameter as an argument. An app can use JavaServer Pages (JSPs) to implement web pages. JSPs are servlets defined using static content, such as HTML, mixed with Java code. App Engine supports automatic compilation and URL mapping for JSPs. A JSP file in the application's WAR (outside of WEB-INF/) whose filename ends in .jsp is compiled into a servlet class automatically, and mapped to the URL path equivalent to the path to the JSP file from the WAR root.
For example, if an app has a JSP file named start.jsp in a subdirectory named register/ in its WAR, App Engine compiles it and maps it to the URL path /register/start.jsp. If you want more control over how the JSP is mapped to a URL, you can specify the mapping explicitly by declaring it with a element in the deployment descriptor. Instead of a element, you specify a element with the path to the JSP file from the WAR root. The element for the JSP can contain initialization parameters. You can install JSP tag libraries with the element. A tag library has a path to the JSP Tag Library Descriptor (TLD) file () and a URI that JSPs use to select the library for loading (). Note that App Engine provides the JavaServer Pages Standard Tag Library (JSTL), and you do not need to install it. An App Engine application can use Google Accounts for user authentication.
The app can use the Google Accounts API to detect whether the user is signed in, get the currently signed-in user's email address, and generate sign-in and sign-out URLs. An app can also specify access restrictions for URL paths based on Google Accounts, using the deployment descriptor. The element defines a security constraint for URLs that match a pattern. If a user accesses a URL whose path has a security constraint and the user is not signed in, App Engine redirects the user to the Google Accounts sign-in page. Google Accounts redirects the user back to the application URL after successfully signing in or registering a new account. The app does not need to do anything else to ensure that only signed-in users can access the URL. A security constraint includes an authorization constraint that specifies which Google Accounts users can access the path. Google Account can access the URL. If the constraint specifies a user role of admin, then only registered developers of the application can access the URL.
|