Custom session timeout popup message in ADF/ Webcenter portal

Hi All,

In ADF and webcenter applications sometimes we have a requirement to show custom session time-out message.I have tried A team article approach as mentioned but this is not working for me in webcenter not even in portal framework or run time portal. So I have tried something to handle this. In ADF application normally we have a popup before session time out and one after the session is expired.

So I need to disable standard warning message for expiry. I did that like below.

To disable to warning for session time out –

Add these entries in web.xml as



Fair enough. Now you will not see any ootb warning before session time out.But I need a customized session time out popup.Following is the solution for that.
Add this code in the your page template for ADF and webcenter application.

 <af:resource type="javascript">
     var timeoutID;
    function resetTimeout(){
        if( timeoutID ) clearTimeout( timeoutID );
        timeoutID = setTimeout( ShowTimeoutWarning, 1500000 ); // this is popup will come if user is idle for 25 minutes(25*6000)
    function ShowTimeoutWarning() {
       var popup = AdfPage.PAGE.findComponentByAbsoluteId('pt_p1');;

    document.onkeyup   = resetTimeout;
    document.onkeydown = resetTimeout;
    document.onclick   = resetTimeout;


and in the page template add a popup.You can also skin your popup as you like through normal skinning.

 <af:popup id="pt_p1" animate="default">
           <af:dialog id="tod" title="Warning" closeIconVisible="false" type="ok">
              <af:outputText value="You session will expire in next 5 Minute." id="pt_ot1"/>

Thats it. You can try this in ADF , webcenter portal framework and or runtime portal too.

Happy learning with Vinay in techartifact.

Get context root or URL of ADF / Webcenter application


I have requirement to get the context root in javascript on page load.Not on any event.If you need on java you can try my previous solution like get the current viewId or url in ADF using ControllerContext. Following solution will work in any application

Try this

window.location.protocol = “http:” // gives you protocol = “”
window.location.pathname = “blogs/2015/08/building-taskflow-for-reuse.html”

var pathArray = window.location.pathname.split(‘/’);
var secondLevelLocation = pathArray[1]; // this will give you the context root of application

Similarly you can get the current page number or param etc in javascript.

Similarly if you need this context root on some button event you can try like passing it using a af:clientAttribute and EL as *#{facesContext.externalContext.request.contextPath}*

<af:document id=”d1”>
<af:resource type="javascript">
        function onLoad(evt){
            var path=evt.getSource().getProperty("pagePath");
            window.location.replace(path);// here we were trying a redirect , just an example
        <af:clientListener method="onLoad" type="load"/>
        <af:clientAttribute name="pagePath"


Happy coding in techartifact

Building ADF Taskflow for reuse

Hi All,

If you making taskflow for reuse either as jar or in portal and so on.Always make sure one property that Library Internal
This property makes an entry in task-flow-registry.xml and enable/disable taskflow to reuse.

Library Internal: This property controls the visibility of a task flow when packaged in an ADF library.
This helps developers to expose only those task flows that are indented for reuse.


if you check this property you will have task-flow-registry.xml as below

<?xml version = '1.0' encoding = 'UTF-8'?>
<task-flow-registry xmlns="">
 <task-flow-descriptor path="../../main/public_html/WEB-INF/testTaskFlow.xml" id="" type="" uses-page-fragments="false" library-internal="true" remote-invocable="false" train="false"/>


So always make sure you never check this property if you want to reuse.Or if you have parent taskflow and 5 sub taskflow which is called by parent taskflow then you can have 5 sub taskflow as
internal library but parent should be as internal library false.

Happy reusing with Vinay in techartifact