With
app.yaml
, you can configure your Java application more easily, and with fewer files, than with the standard
web.xml
configuration.
You can use
app.yaml
as long as your application does not need to be portable to other Java application servers.
Note: If you created your project using the Google Developers Console , your project has a title and an ID. In the instructions that follow, the project title and ID can be used wherever an application title and ID are mentioned. They are the same thing.
-
About
app.yaml
- Required elements
- Static files and resource files
- Enabling sessions
- System properties, environment variables, and context parameters
- Servlet context listeners
- Secure URLs
- Requiring login or administrator status
- The welcome file list
- Skipping files
- Reserved URLs
- Inbound services
- Disabling precompilation
- Administration console custom pages
- Custom XML Output
- Custom error responses
- Custom PageSpeed configuration
- Auto ID policy
About
app.yaml
app.yaml
specifies how URL paths correspond to request handlers and static files. It also contains information about the application code, such as the application ID and the latest version identifier. This file is stored in the application's
WEB-INF
directory.
One of the benefits of using
app.yaml
is that it automatically generates
web.xml
and
appengine-web.xml
for you. It overwrites any content you may have written in those files. If you need to include a feature in
web.xml
that
app.yaml
doesn't support, simply specify it in
app.yaml
using
web_xml
.
The following is an example of a basic
app.yaml
file:
application: myapp version: 1 runtime: java handlers: - url: /admin/* login: admin
The syntax of
app.yaml
is the YAML format. For more information about this syntax, see
the YAML website
.
The YAML format supports comments. A line that begins with a pound (
#
) character is ignored:
# This is a comment.
URL and file path patterns use
POSIX extended regular expression syntax
, excluding collating elements and collation classes. Back-references to grouped matches (e.g.
\1
) are supported, as are these Perl extensions:
\w \W \s \S \d \D