JDev 11gR1: Force redirect to certain page upon sucessfull authentication

Hello,
I am following "Enabling ADF Security in a Fusion Web Application" part of fusion developer documentation. I need to make sure that no matter which page is called, that upon successfull authentication, framework redirects user to a certain page, say welcome.jspx
I thought that this is already done in steps "Configure ADF Security" since in web.xml I have this entry:
<servlet>
    <servlet-name>adfAuthentication</servlet-name>
    <servlet-class>oracle.adf.share.security.authentication.AuthenticationServlet</servlet-class>
    <init-param>
      <param-name>success_url</param-name>
      <param-value>/faces/welcome.jspx</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
  </servlet>I am using Loginbean and jspx login page as per documentation mentioned above
Any ideas?

Well then I am puzzled how this redirect works. Here is the code from the documentation:
    public String doLogin() {
        String un = _username;
        byte[] pw = _password.getBytes();
        FacesContext ctx = FacesContext.getCurrentInstance();
        HttpServletRequest request =(HttpServletRequest)ctx.getExternalContext().getRequest();
        CallbackHandler handler = new SimpleCallbackHandler(un, pw);
        try {
            Subject mySubject = Authentication.login(handler);
            ServletAuthentication.runAs(mySubject, request);
            ServletAuthentication.generateNewSessionID(request);
            String loginUrl = "/adfAuthentication?success_url=/faces" + ctx.getViewRoot().getViewId();
            System.out.println("loginUrl= "+loginUrl);
            //String loginUrl = "/adfAuthentication?success_url=/faces/welcome.jspx";
            HttpServletResponse response = (HttpServletResponse)ctx.getExternalContext().getResponse();
            System.out.println("requestURI= "+request.getRequestURI());
            sendForward(request, response, loginUrl);
        } catch (FailedLoginException fle) {
            FacesMessage msg = new FacesMessage(FacesMessage.SEVERITY_ERROR,
                                            "Incorrect Username or Password",
                                            "An incorrect Username or Password" +
                                            " was specified");
            ctx.addMessage(null, msg);
            setPassword(null);
            fle.printStackTrace();
        } catch (LoginException le) {
            reportUnexpectedLoginError("LoginException", le);
        return null;
    private void sendForward(HttpServletRequest request,
                              HttpServletResponse response,
                              String forwardUrl){
        FacesContext ctx = FacesContext.getCurrentInstance();
        RequestDispatcher dispatcher = request.getRequestDispatcher(forwardUrl);
        System.out.println("forwardUrl= " + forwardUrl);
        try {
            dispatcher.forward(request, response);
        } catch (ServletException se) {
            reportUnexpectedLoginError("ServletException", se);
        } catch (IOException ie) {
            reportUnexpectedLoginError("IOException", ie);
        ctx.responseComplete();
    private void reportUnexpectedLoginError(String errType, Exception e){
        FacesMessage msg =
        new FacesMessage(FacesMessage.SEVERITY_ERROR, "Unexpected error during login",
                         "Unexpected error during login (" + errType +
                         "), please consult logs for detail");
        FacesContext.getCurrentInstance().addMessage(null, msg);
        //e.printStackTrace();
    }So I call a page birth.jspx (one of my application pages) which is prottected by ADF Security. Framework redirects to LoginPage.jspx, then calls the bean above and upon Authentication redirects to the initially called page birth.jspx
It is not clear to me how this works. I thought that
String loginUrl = "/adfAuthentication?success_url=/faces" + ctx.getViewRoot().getViewId();
will retreive the viewID of the calling page from the context ie birth.jspx but it actually gets LoginPage.jspx so the loginUrl string becomes: "/adfAuthentication?success_url=/faces/LoginPage.jspx"
Thereafter private method sendForward somehow redirects to birth.jspx. How?
I have tried to overwrite loginUrl to "/adfAuthentication?success_url=/faces/welcome.jspx" but this only works (redirects to desired welcome.jspx) if initially called page is LoginPage.jspx

Similar Messages

  • How to redirect to a page dynamically after authentication Apex

    We have developed an application and the application id is 333.
    we have developed a login screen(page No. 111).
    After login Company page (Page No.1) will appear where the user selects the company name.
    Once company is selected, the control goes to Menu Page(Page No.10). The menu will be displayed based on the user rights.
    In shared Components - Authentication scheme,
         In session Not Valid region, URL option is selected and URL is assigned as "we have given "f?p=&APP_ID.:111:&SESSION."
         In Logout URL, URL option is enabled and URL is assigned as "f?p=&APP_ID.:111"
    In shared Components - Security Attributes,
         In Authentication region, in HOME link "f?p=&APP_ID.:1:&SESSION." is assigned
    In login page (Page No. 111), we have created a process "On Submit - After computation and validations".
         in that
              we are checking a condition like
              if the user has access to Only one company then he will be redirected to Menu_page(Page No.10).
              if the user has access to more than one company then he will be redirected to Company Page(Page No.1).
    if "No. of company access" =1 then
    wwv_flow_custom_auth_std.login (p_uname => :p111_username,
    p_password => :p111_password,
    p_session_id => v ('APP_SESSION'),
    p_flow_page => :app_id||':10'
    else
    wwv_flow_custom_auth_std.login (p_uname => :p111_username,
    p_password => :p111_password,
    p_session_id => v ('APP_SESSION'),
    p_flow_page => :app_id||':1'
    end if;
    The above condition is not working. ie. it is always loading Company Page(Page No.1) even if the user has access to one company alone.
    Can anyone point out the place where I have done wrong. Or please suggest me a method to achieve the above said task.

    Hi User490632,
    During the login,
    it using the custom authentication function which I mentioned below,
    *create or replace FUNCTION custom_auth_g (
    p_username IN VARCHAR2,
    p_password IN VARCHAR2)
    RETURN BOOLEAN IS
    BEGIN
    FOR c1 IN (SELECT 1
    FROM login_table
    WHERE upper(username) = upper(p_username)
    AND upper(password) = upper(p_password))
    LOOP
    RETURN TRUE;
    END LOOP;
    RETURN FALSE;
    END;*
    its working fine, If I give the username and password which exist in the table login_table.
    Now I need to redirect to 2 different pages.
    if the username is 'guru' then when he clicked the login button he has to redirect to page 2,
    if username is any other name except 'guru' they have to be redirected to page 3.
    Can you please give the step by step procedure to follow?
    Thank you.
    Regards,
    gurujothi

  • How to redirect users to certain page on login

    Hello All,
    I need to redirect users to page 1 after login even if they use a direct URL pointing to some other page. How do i achieve this?
    Ex:
    User logs in using URL:
    http://localhost:port/apex/f?p=101:10:1818843916449354::NO:::should redirect him to below page instead of 10:
    http://localhost:port/apex/f?p=101:1:2314843916462565::NO:::Appreciate your reply.
    Thanks and Regards,
    Senana

    Hello Senana,
    Assuming you're using wwv_flow_custom_auth_std.login to log in, and p_flow_page is set to "[your app id]:1" try placing the following line just before your call to wwv_flow_custom_auth_std.login:
    :FSP_AFTER_LOGIN_URL := null;This should force user to page 1 after log-in.
    Hope this helps,
    John

  • Redirect for specific page for certain user

    All if i had a user that i just wanted to see one certain page, how can i set it up that one he /she logs in they get sent to that page. I did try the brances but when i put in
    Branch to page 37
    Condition "Value of Expression 1 = Expression 2"
    val1 :APP_USER
    val2 : SALES
    The page just redirects to the default page. The seq for the branch is set to be above
    the normal login seq

    I tried to solve the problem on another way. I authenticate users with data in the USERS table and my own authentication function. I have in this table a field with page number for redirection. I put this number in a :P101_PAGE item (and user_id in application item :APP_USER_ID) before calling login function. The login call is:
    www_flow_custom_auth_std.login(
    P_UNAME => upper(:P101_USERNAME),
    P_PASSWORD => :P101_PASSWORD,
    P_SESSION_ID => v('APP_SESSION'),
    P_FLOW_PAGE => :APP_ID||':'||v('P101_PAGE'));
    It works properly every second time.
    After proper redirection the session state is:
    P101_PAGE null
    FSP_AFTER_LOGIN_URL null
    APP_USER_ID null
    Otherwise (wrong redirection to page 1)
    P101_PAGE 10 (ok)
    FSP_AFTER_LOGIN_URL f?p=100|1 (fault)
    APP_USER_ID 1 (ok)
    Why is it so?

  • Redirect to Error Page Example ?

    Hi,
    Anybody, have an error page working example of how to redirect to error page in 10.1.3, i tried it many ways , followed the ADF Dev Guide PDF page 395 and 396 and no luck.
    where i should write the <error-page> and <dispatcher>REQUEST</dispatcher>
    and <dispatcher>ERROR</dispatcher>
    tags in web.xml
    any tricks in that ???
    thanks in advance

    Hi Frank,
    thanks for replying , unfortunately it did not work , it give me
    "The page cannot be displayed" , it seems that the Exception have been caught but it can't display the error page
    here is my web.xml
    <?xml version = '1.0' encoding = 'windows-1252'?>
    <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee">
    <description>Empty web.xml file for Web Application</description>
    <context-param>
    <description>Makes Security View Handler printing debug messages at runtime</description>
    <param-name>com.groundside.jsf.security.print_debug_messages</param-name>
    <param-value>true</param-value>
    </context-param>
    <context-param>
    <description>Customize error message shown upon unauthorized access attempt</description>
    <param-name>com.groundside.jsf.security.unauthorized_access_error_messages</param-name>
    <param-value>User is not authorized to perform requested action</param-value>
    </context-param>
    <context-param>
    <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
    <param-value>client</param-value>
    </context-param>
    <context-param>
    <param-name>CpxFileName</param-name>
    <param-value>view.DataBindings</param-value>
    </context-param>
    <filter>
    <filter-name>adfBindings</filter-name>
    <filter-class>oracle.adf.model.servlet.ADFBindingFilter</filter-class>
    </filter>
    <filter>
    <filter-name>adfFaces</filter-name>
    <filter-class>oracle.adf.view.faces.webapp.AdfFacesFilter</filter-class>
    </filter>
    <filter-mapping>
    <filter-name>adfBindings</filter-name>
    <url-pattern>*.jsp</url-pattern>
    </filter-mapping>
    <filter-mapping>
    <filter-name>adfBindings</filter-name>
    <url-pattern>*.jspx</url-pattern>
    </filter-mapping>
    <filter-mapping>
    <filter-name>adfFaces</filter-name>
    <url-pattern>*.jsp</url-pattern>
    </filter-mapping>
    <filter-mapping>
    <filter-name>adfFaces</filter-name>
    <url-pattern>*.jspx</url-pattern>
    </filter-mapping>
    <servlet>
    <servlet-name>Faces Servlet</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet>
    <servlet-name>resources</servlet-name>
    <servlet-class>oracle.adf.view.faces.webapp.ResourceServlet</servlet-class>
    </servlet>
    <servlet>
    <servlet-name>JsfAuthenticationServlet</servlet-name>
    <servlet-class>com.groundside.jsf.pagesecurity.authentication.J2eeAuthenticationServlet</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>/faces/*</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
    <servlet-name>resources</servlet-name>
    <url-pattern>/adf/*</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
    <servlet-name>JsfAuthenticationServlet</servlet-name>
    <url-pattern>/jsfauthentication</url-pattern>
    </servlet-mapping>
    <session-config>
    <session-timeout>35</session-timeout>
    </session-config>
    <mime-mapping>
    <extension>html</extension>
    <mime-type>text/html</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>txt</extension>
    <mime-type>text/plain</mime-type>
    </mime-mapping>
    <error-page>
    <exception-type>java.lang.Exception</exception-type>
    <location>errorpage.jsp</location>
    </error-page>
    </web-app>
    here is how i make the exception
    public void commandButton1_action() throws Exception {
    throw new java.lang.Exception();
    here is the code of the page that have the button that throws the exception
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <%@ page contentType="text/html;charset=windows-1252"
    import="java.lang.Exception"%>
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
    <%@ taglib uri="http://xmlns.oracle.com/adf/faces" prefix="af"%>
    <%@ taglib uri="http://xmlns.oracle.com/adf/faces/html" prefix="afh"%>
    <f:view>
    <afh:html binding="#{backing_untitled3.html1}" id="html1">
    <afh:head title="untitled3" binding="#{backing_untitled3.head1}" id="head1">
    <meta http-equiv="Content-Type"
    content="text/html; charset=windows-1252"/>
    </afh:head>
    <afh:body binding="#{backing_untitled3.body1}" id="body1">
    <h:form binding="#{backing_untitled3.form1}" id="form1">
    <af:commandButton text="commandButton 1"
    binding="#{backing_untitled3.commandButton1}"
    id="commandButton1"
    action="#{backing_untitled3.commandButton1_action}"/>
    </h:form>
    </afh:body>
    </afh:html>
    </f:view>
    <%-- oracle-jdev-comment:auto-binding-backing-bean-name:backing_untitled3--%>
    here is the errorpage.jsp
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <%@ page contentType="text/html;charset=windows-1252"%>
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
    <%@ taglib uri="http://xmlns.oracle.com/adf/faces" prefix="af"%>
    <%@ taglib uri="http://xmlns.oracle.com/adf/faces/html" prefix="afh"%>
    <f:view >
    <html>
    <head>
    <meta http-equiv="Content-Type"
    content="text/html; charset=windows-1252"/>
    <title>untitled4</title>
    </head>
    <body>eeeeeror</body>
    </html>
    </f:view>
    <%-- oracle-jdev-comment:auto-binding-backing-bean-name:backing_untitled4--%>
    by the way , in the error page if i change the f:view to f:subview , the page itself will not run
    thanks very much for your time.
    Message was edited by:
    bassem.farouk

  • Firefox 17.0.1 in Vista Home Premium, svc pak 2, experiencing Google redirects to spam pages

    As referenced in a now closed thread on this site that refers to XUL Runner & XUL cache and certain registry entries as the cause. I am experiencing a very high percentage of redirects to spam pages when I use Google search in Firefox, but not IE. How can I stop this?
    I have searched Firefox extensions and plugins for any files similar to those mentioned in the articles, or anything similar, or anything that looks suspicious, with no results. I have searched the registry for entries such as those described, or similar, or otherwise suspicious, also with no results.
    What I am experiencing though, sounds like exactly what is being discussed. Google support has a web page for reporting redirects like this, which makes me thing it may be a known issue?
    http://support.google.com/websearch/bin/request.py?contact_type=reporting_malware&hl=en&page=ts.cs&ts=1209905&1209905=1209909&1209909=1210107

    Google redirect virus is challenging to get rid of due to its capability to hide deep inside the operating system as well as its potential to eliminate traces and footprints on how it got inside the computer. As of nowadays, not a single security application in the industry can guarantee 100% protection from this infection. This explains, why your pc got infected even having a safety software installed.
    Some computer users know that Google redirect virus is just not a virus, but in fact a rootkit. Rootkit infections unlike other virus, spyware or trojan infections are really difficult to get rid of. In most cases, google redirect virus rootkit is seen related to Trojans which makes it a lot more deadly. In accordance with a 2011 report, Google redirect virus have currently infected 45,00,000 computers worldwide, out of which 1/3rd is from US.
    Some symptoms that you are having this virus on your PC:
    * Browsers freeze
    * Pages not loading at all
    * Google/Bing/Yahoo searches redirected to malicious site/s
    * Some programs won’t respond
    * Internet connection brakes itself
    * Terrible adds popping on visited webpage/s
    If you have these symptoms on your Computer, I suggest using safe and respected software program as the 1 I've provided below. The Google redirect virus removal tool deals with malware infections that lead to Google redirect virus symptoms and are so difficult to detect and fix.
    ''moderator removed spam link'' <br />
    ''[https://support.mozilla.com/en-US/kb/Forum+and+chat+rules+and+guidelines Forum rules and guidelines]''

  • Can character encoding be predefined for certain pages?

    Certain pages that I visit frequently require me to manually set my character encoding to Western (ISO Latin 1), both when my default character encoding is set as UTF-8 and Western (ISO Latin 1).
    As the pages that show up malformed are embedded in other frames I suspect that the top frame forces a different encoding than is on the embedded page.
    An example page is here (847.is). The topic list of this message board is in order, but when any one of the topics is viewed all accented and special characters are missing, until Western (ISO Latin 1) is manually set as the character encoding. Similarly, opening any of the topics in a tab will result in missing characters.
    Is there some way for me to circumvent having to go through all those menus to set it? Can I somehow define that these pages should be viewed in Western (ISO Latin 1) or can I set a keyboard shortcut for Western (ISO Latin 1)?
    MacBook 2006   Mac OS X (10.4.7)   Safari version 2.0.4
    MacBook 2006   Mac OS X (10.4.7)  

    For instance if I opened
    an entry on Vísindavefur
    HÍ out
    of the parent frame the accented letters would
    show up somehow mangled, but this is no longer a
    problem.
    That page has no charset in the source and thus should only display correctly if you have Latin-1 set as the browser default. With UTF-8 set as the default you should see (in Safari) a ton of black diamonds with question marks inside.
    Firefox never displays ð (eth), þ (thorn) and ý
    (accented y) correctly for me, did not do it on the
    old machine and does not do it on this one either,
    FireFox displays them perfectly for me in both 10.3 and 10.4.
    Actually, if I set Opera encoding to UTF-8 it
    displays the topics on 847.is as Safari does.
    This indicates it is a system issue rather than Safari. Sorry I can't duplicate it and have no good idea what could cause it on a normal system. Have you (or the place where you buy your machines) by chance installed any special software add-ons to enable the use of non-Unicode Icelandic (for apps like Appleworks, WordX, etc)?

  • How do I make Foxfire quit giving me the message Firefox prevented this page from automatically redirecting to another page?

    When I am on some sites Firefox gives me the message Firefox prevented this page from automatically redirecting to another page? and then I have to click Allow. This happens on every single page on certain sites. How can I make this stop all together?

    * [http://kb.mozillazine.org/Menu_differences Firefox > Preferences] > Advanced > General : Accessibility : [ ] "Warn me when web sites try to redirect or reload the page"

  • Can't open certain pages.

    I just got an iMac and have began to use Safari. I really like it.. but oddly, I can't open certain pages that I can on other browsers. (tested this).
    xbox.com - log in (or any of the Windows Live ID pages) ex: https://login.live.com/login.srf?wa=wsignin1.0&rpsnv=11&ct=1342238079&rver=6.2.6 289.0&wp=MBI&wreply=https:%2F%2Flive.xbox.com:443%2Fxweb%2Flive%2Fpassport%2Fset Cookies.ashx%3Frru%3Dhttps%253a%252f%252flive.xbox.com%252fen-US%252fAccount%252 fSignin%253freturnUrl%253dhttp%25253a%25252f%25252fwww.xbox.com%25252fen-US%2525 2f&lc=1033&id=66262&cbcxt=0
    OR
    Any of the mlb.com gameday pages, such as ex: http://mlb.mlb.com/mlb/gameday/index.jsp?gid=2012_07_13_arimlb_chnmlb_1&mode=wra p
    I don't know what could cause this. The iMac is brand new, and I am not running any programs/scripts.
    Help?

    On the xbox log in, I get redirected to the link I provided which just shows a blank white screen with the Microsoft Inc. in green at the top of the URL bar. I get redirected after going to xbox.com -> sign in (at the top right). Cannot understand why.
    For mlb.com, I only load the banner in 'gameday', opposed to the reviews, previews, box score, etc.
    Makes no sense because on this same Mac, Chrome and Firefox can load these pages.

  • I want to force SSL on some pages and NO SSL on other pages

    I have looked at webflow and it is not obviously clear to me how to:
    1.  Enforce NON SSL on some pages ... (like search page, catalog, product list pages ) to improve performance.
    2.  Force SSL on other pages  .... (like account edit page, beyond the obvious checkout pages)
    One way I was thinking off was to use a URL rewrite intercept to do that.
    The webflow seems to be a mechanism to build page flows enforcing SSL on the next page called.   But what if the user is the person directly clicking on a link that should be SSL'ed say Account Update.
    Currently ... we are ssl'ing the whole site.
    Mike

    I have it within an ascx control which appears on each page. Alternatively, within the common.master.master codebehind page load event. I think the problem with the webflow is that you need to know which page a user is coming from to be able to take them into (and then out of) secure mode. This code ensures that certain pages are secure and others are not.
    Also, Fname in the above example is the name of the page that is being requested:
    Fname = mid(Request.Path, Request.Path.LastIndexOf("/") +2,len(Request.Path) - (Request.Path.LastIndexOf("/") +1) )
    Edited by: Martin Barrett on Jul 23, 2009 4:07 PM
    Edited by: Martin Barrett on Jul 23, 2009 4:10 PM

  • Browser can't load certain pages

    I experience this problem with Safari, Firefox and Netscape. Certain pages -- ESPN is a good example -- load halfway and then stop, and all I get is the spinning rainbow ball. I always have to force quit. This started a few weeks ago. I assume it's a plug-in of some kind, but reinstalling Firefox didn't seem to help. Any ideas? Thanks!

    Hello there,
    Do you have a style sheet [ CSS ] you are using in Safari-> Advanced Tab? if yes set it to none, and see if that helps.
    Whilst in Advanced tab check your network settings & make sure you've no proxies checked on.
    In " View " Check your Text encoding try using Unicode.
    Have you tried a restart,if the puter that can help.
    Have you run permission repair and see if DU reports any errors.
    In Utilities Disk Utility, First Aid tab. do not bother with verify perm.
    do run repair permissions. Stay on the left side of the Disk Utility
    < [ not repair disk ] if you know already, sorry.
    Good Luck, I hope something helps..
    Eme: )

  • My fans get loud when loading certain pages on the web?

    My fan on my pc goes haywire, and gets loud when I load certain pages on the web...maybe pages with High definition? (Not sure)
    Anyway, it only happens when I go to certain sites...or load videos etc. on like youtube etc. This just started happening recently, and has gotten worse in the last few days. Is it possible that my processor cannot handle the grahics or High Def...that Firefox 4.0 provides?

    All that means is that Firefox 4 is throwing a heavy load on your CPU, causing it to run hotter for a while.
    But you might be able to quiet your computer by opening it up and giving the CPU's heat sink a thorough cleaning. The dirtier the heat sink is, the less efficient it is--forcing the fan to run faster to keep the CPU cool.

  • Page not getting Redirected in APEX page

    Hi,
    I have an Apex page with Tabular form region.
    I kept a text area in another region of same page. I need to save the text entered in this text area to another table apart from the table that is attached to the tabular form.
    I added a button to this region and trying to save the text entered in the text area to the table and redirect to next page by using below code in Process. But it is not happening.
    BEGIN
    IF NVL(:TAF,'-1') != '-1' THEN
    UPDATE catering_orders
    SET add_food_req = :TAF
    WHERE order_ref = :H;
    COMMIT;
    END IF;
    BEGIN
    owa_util.status_line(301,NULL, FALSE);
    owa_util.redirect_url('f?p=121:27:&APP_SESSION.::::H:'||l_max_no,TRUE);
    END;
    END;
    It is neither updating nor going to the next page because I have a tabular form region in my page. It is staying in the same page without any error.
    Please help me in this issue.
    Thank you
    Regards
    Dev

    Dev:
    Add the highlighted line as shown
    BEGIN
    owa_util.status_line(301,NULL, FALSE);
    owa_util.redirect_url('f?p=121:27:&APP_SESSION.::::H:'||l_max_no,TRUE);
    *apex_application.g_unrecoverable_error := true;*
    END; Varad

  • Session Time Out and Redirect to login page - urgent

    My problem is I want to display alert message and redirect to the home page when session expires.
    Iam using TimeOutListener in my application as follows.
    public PhaseId getPhaseId() {
    return PhaseId.ANY_PHASE;
    public void beforePhase(PhaseEvent phaseEvent) {
         FacesContext facesContext = phaseEvent.getFacesContext();
    HttpSession sessionx = (HttpSession)facesContext.getExternalContext().getSession(false);
    if(sessionx == null) {
         FacesUtils.sessionCheck = true;
    String ampee = (String)((HttpServletRequest)FacesContext.getCurrentInstance().getExternalContext().getRequest()).getAttribute("ampee");
    if(ampee != null && ampee.equals("ampee")) FacesUtils.sessionCheck = false;
    if(phaseEvent.getPhaseId() == PhaseId.RENDER_RESPONSE) {
         if(FacesUtils.sessionCheck){
         facesContext.getApplication().getNavigationHandler().handleNavigation(facesContext, "", "sessionExpired" );
         FacesUtils.sessionCheck = false;
    ExternalContext externalContext = FacesContext.getCurrentInstance().getExternalContext();
              HttpServletRequest request = (HttpServletRequest) externalContext.getRequest();
              HttpSession session = request.getSession();
              if (session.isNew()) {
                   try {
                   String errorPageURL = externalContext.getRequestContextPath() +
                   "/index.jsf?errorpage=true";
                   externalContext.redirect(errorPageURL);
                   }catch(Exception e){
                        e.printStackTrace();
    here i have appended param errorPage=true...
    in jsp page i have used following code to get the param<% if(request.getParameter(errorPage)!=null && request.getParameter(errorPage).equals("true")){%>
    <script>alert("session expired");</script>
    <%
    %>
    Can any one help me how to Implement this?
    Do u know another way pls let me know...

    Consider using the Javascript setTimeout() function in conjunction with HttpSession#getMaxInactiveInterval(). The HttpSession#getMaxInactiveInterval() returns the remaining seconds of the session lifetime.
    Basic example:<script>
        setTimeout("alert('The session will timeout after one minute.')", <%= (session.getMaxInactiveInterval() * 1000) - 60000 %>);
    </script>I've given the client one minute (60000ms) extra time space to respond accordingly.
    Use this in combination with the following head:
    <meta http-equiv="refresh" content="<%= session.getMaxInactiveInterval() %>;url=login.jsf">which will redirect to login.jsf if the session is timed out. You can also redirect to another page of your taste, e.g. error.jsf or so.

  • How can I extract certain pages from my document and save as another file?

    How can I extract certain pages from my document and save as another file?

    You would need Adobe Acrobat to do that, not Adobe Reader.

Maybe you are looking for