The URL that displays for each page identifies the location of Oracle Application Express, the address of Oracle Application Express, the application ID, the page number, and the session ID.
The application ID is a unique number that identifies each application. Similarly, the page number uniquely identifies each page. Applications and pages may also have alphanumeric aliases. Application aliases are unique within a workspace and page aliases are unique within each application. When you run an application, the Application Express engine generates a session number that serves as a key to the user's session state.
Topics in this section include:
The URL that displays for each page indicates the location of Oracle Application Express and identifies the address of Oracle Application Express, the application ID, page number, and session ID. For example:
This example indicates:
apex.somewhere.com is the URL of the server
pls is the indicator to use the
apex is the database access descriptor (DAD) name. The DAD describes how HTTP Server connects to the database server so that it can fulfill an HTTP request. The default value is
f?p= is a prefix used by Oracle Application Express
4350 is the application being called
1 is the page within the application to be displayed
220883407765693447 is the session number
See Also:"About Publishing the Application URL"
You can create links between pages in your application using the following syntax:
Table 3-2 describes the arguments you can pass when using
Indicates an application ID or alphanumeric alias.
Indicates a page number or alphanumeric alias.
Identifies a session ID. You can reference a session ID to create hypertext links to other pages that maintain the same session state by passing the session number. You can reference the session ID using the syntax:
Sets the value of
Displays application processing details. Valid values for the DEBUG flag are
See Also: "Debugging an Application"
Clears the cache. This sets the value of items to null.
To clear cached items on a single page, specify the numeric page number. To clear cached items on multiple pages, use a comma-separated list of page numbers. Clearing a page's cache also resets any stateful processes on the page. Individual or comma-separated values can also include collection names to be reset or the keyword
See Also: "Clearing Session State"
Comma-delimited list of item names used to set session state with a URL.
List of item values used to set session state within a URL. Item values cannot include colons, but can contain commas if enclosed with backslashes. To pass a comma in an item value, enclose the characters with backslashes. For example:
Determines if the page is being rendered in printer friendly mode. If PrinterFriendly is set to Yes, then the page is rendered in printer friendly mode. The value of PrinterFriendly can be used in rendering conditions to remove elements such as regions from the page to optimize printed output. You can reference the printer friendly preference by using the following syntax:
When referenced, the Application Express engine will not display tabs or navigation bars, and all items will be displayed as text and not as form elements.
Although it is important to understand how
f?p syntax works, you rarely have to construct this syntax yourself. Application Builder includes many wizards that automatically create these references for you. The following sections describe specific instances that utilize
f?p syntax to link pages.
Application and page aliases must consist of valid Oracle identifiers, cannot contain any whitespace, and are not case-sensitive. The following example calls a page using an application and a page alias from within an application. It runs the page
home of the application
myapp and uses the current session ID.
Application aliases must be unique within a workspace. If an application in a different workspace has the same application alias, use the
&c argument to specify the workspace name. For example:
When you create a button, you can specify a URL to redirect to when the user clicks the button. This example runs page 6001 of application 6000 and uses the current session ID.
Note that this is only one approach to using a button. This method bypasses page submission and acts as a hyperlink on the page. Another method is to submit the page first. In that approach, clicking the button submits the page for processing, allowing forms to be submitted and session state to be saved.
If the pages within an application are public and do not require authentication, you make it easier for application users to bookmark pages by using zero as the session ID.
Application pages that do not require authentication can be accessed with "f?p" URLs where the session ID is zero (that is, the single digit
0). When you request a page by either entering the URL in the browser or by clicking on a link having
0 for the session ID, the Application Express engine assigns a new session ID and sends a session cookie containing this new session ID to your browser. As you navigate through the application's public pages, you will see that all generated links to public pages will contain
0 for the session ID and all branches to public pages will have new URLs that use
0 as the visible session ID. Behind the scenes, however, the Application Express engine uses the session ID in the cookie as the actual session ID to locate session state.
This feature is useful when you want to hide the actual session ID. By hiding the session ID, you enable users to bookmark pages without needing to include the session ID in the bookmark link. As an added benefit, using zero as the session ID also keeps the actual session ID hidden from search engines.
In order to use zero as the session ID in your application, you have to generate at least one link having a zero session ID. The use of this first link starts the zero session ID mechanism. One approach would be to provide a single static link with a zero session ID on the application home page. For example, where you might normally code the link to page 2 as
f?p=&APP_ID.:2:&APP_SESSION, you would code
Oracle provides a utility function to enable developers to use PL/SQL to generate anchors to application pages using the f?p syntax. Use
APEX_UTIL.PREPARE_URL whenever PL/SQL in the application produces f?p anchors that might require a zero session ID. To learn more, see "PREPARE_URL" in Oracle Application Express API Reference.
The zero session ID feature provides support for pages having anchors in the HTML (such as in templates or HTML regions). When the Application Express engine encounters
f?p anchors it recognizes them and replaces the session ID with zero, if certain criteria are met.
The Application Express engine replaces the session ID component with zero when it detects one of the following patterns:
The numeric ID of the current application
One of the following patterns:
the all-uppercase or all-lowercase alphanumeric alias of the current application followed by a colon followed by the numeric ID of a public page in the current application
the all-uppercase or all-lowercase alphanumeric alias of a public page in the current application followed by a colon followed by
Examples of patterns in HTML that are candidates for zero-session ID replacement include:
Page 10 is a public page:
Page 10 is a public page:
home is an alias for a public page:
HOME is an alias for a public page:
PEOPLE is an application alias and
HOME is an alias for a public page:
In these examples, the pattern
&SESSION., not shown) is replaced with zero if the application is operating in zero-session ID mode and the user is a public user. Note that the user is considered a public user if the following PL/SQL expression is true:
:app_user in ('nobody','HTMLDB_PUBLIC_USER','PUBLIC_USER','ANONYMOUS','APEX_PUBLIC_USER')"