/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */
a1: -
any:a1 was null, set to 0
a1: 0
page:a1 was 0, set to 1
a1: 1
request:a1 was null, set to 2
session:a1 was null, set to 3
application:a1 was null, set to 4
Request.a1: 2
Session.a1: 3
Application.a1: 4
a1: 1
page:a1 was 1, set to null
a1: 2
request:a1 was 2, set to null
a1: 3
session:a1 was 3, set to null
a1: 4
application:a1 was 4, set to null
a1: -

a2: -
application:a2 was null, set to 4
a2: 4
session:a2 was null, set to 3
a2: 3
request:a2 was null, set to 2
a2: 2
page:a2 was null, set to 1
a2: 1

G1
page:a1 was G1, set to P1
P1

G2
page:a2 was G2, set to P2
P2

Values created in the template:
String: s [java.lang.String]
Number: 1 [java.math.BigDecimal]
Boolean: true [java.lang.Boolean]
Date-time: 2014-12-20T16:19:00Z [java.util.Date]
Sequence: [1, 2, 3] [freemarker.ext.beans.SequenceAdapter]
Hash: {a=1, b=2, c=3} [freemarker.ext.beans.HashAdapter]

Values created in Java:
LinkedList: [1, 2, 3] [java.util.LinkedList]
ArrayList: [1, 2, 3] [java.util.ArrayList]
MyList: [1, 2, 3] [freemarker.ext.jsp.RealServletContainertTest$MyList]
LinkedHashMap: {a=1, b=2, c=3} [java.util.LinkedHashMap]
TreeMap: {a=1, b=2, c=3} [java.util.TreeMap]
MyMap: {a=1, b=2, c=3} [freemarker.ext.jsp.RealServletContainertTest$MyMap]
TreeSet: [1, 2, 3] [freemarker.ext.beans.SequenceAdapter]