Delayed Message When URL redirect for Oracle APEX application

I’ve recently moved our internal APEX applications to a new environment. We have new URL for applications. During the transition, even though users are informed with new URL and asked to switch to it, we still want the old URL to redirect to new one for a period of time to ensure the smooth transition.

Oracle APEX provides the redirect capability by making the application Unavailable then perform Redirect to URL. This feature can be found under the Availability section from Shared Components > Definition.

The Unavailable (Redirect to URL) works well if we would maintain the old URL. When user enters the old URL, they will be automatically redirected to new one. The redirect happens very quickly.

In our case, since the old URL will be retired, we’d would like users to be aware of the change. Before redirecting to new URL, we’d like to display a message informing about the move and asking them to take an appropriate action.

To do this, instead of using Unavailable (Redirect to URL), I will use Unavailable (Status Shown with PL/SQL) instead.

The PL/SQL block just simply writes a Javascript to perform redirect. We will give a 3-second delay for users to read the message before the redirect takes place.

[source language=”html”]
htp.p (‘<html>’);
htp.p (‘<head>’);
htp.p (‘<script type="text/javascript">’);
htp.p (‘function delayed_redirect() {‘);
htp.p (‘ window.location = ""’);
htp.p (‘}’);
htp.p (‘</script>’);
htp.p (‘</head>’);
htp.p (‘<body onLoad="setTimeout(”delayed_redirect()”, 3000)">’);
htp.p (‘<h1>The application has moved.</h1>’);
htp.p (‘<h2>The redirect will NOT work after 3/1/2011. Please bookmark the new URL.</h2>’);
htp.p (‘</body>’);
htp.p (‘</html>’);

Here is what will be displayed for about 3 seconds before going to the new site.

4 thoughts on “Delayed Message When URL redirect for Oracle APEX application”

  1. Pingback: OraExplorer » The Developer Toolbar in APEX Application Disappeared

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Scroll to Top