|The mvc:URI scheme is a special URI format that accesses different resources, depending on the device class. This scheme is used by the Portal 8001 theme in the definition of several dynamic content spots.
The syntax of its scheme-specific part allows the following options:
- Specify the default URI to be used when no other listed URI matches.
- Map to an empty URI by using the syntax ...,name@,...
- Create a comma-separated list of entries where:
- The individual entries of the list are key and value pairs that are separated with '@'.
- The keys represent one or more device class names that are separated with '/'.
- The value is a URI that must be properly encoded to not use any of the special characters that are described here. Therefore, certain values such as the comma must be double-encoded.
You can also use URIs with query parameters, for example mvc:uri1?foo=bar&hugo=123,tablet@uri1_tablet%252ftoken1
. Note the use of double encoding to represent a comma as part of a resource URI , = pct %2f, % = pct %25
The following examples demonstrate some of the possible combinations:
Parent topic: Device classes overview
- mvc:res:/hello.jsp: Uses a single default URI.
- mvc:res:/hello.jsp,smartphone@res:/hello_smartphone.jsp: Uses res:/hello.jsp as the default URI and res:/hello_smartphone.jsp as the URI for smartphones.
- mvc:res:/hello.jsp,smartphone/tablet@res:/hello_mobile.jsp: Uses res:/hello.jsp as the default URI and res:/hello_mobile.jsp as the URI for smartphones and tablets.
- mvc:res:/hello.jsp,smartphone@,tablet@res:/hello_tablet.jsp: Uses res:/hello.jsp as the default URI and res:/hello_tablet.jsp as the URI for tablets. No URI is assigned for smartphones.