How to redirect to a page (without branching and without pl/sql)

Hi,
Have a requirement where when a user log into the application, the APP_USER must be checked against the list of users maintained in a database table, if APP_USER name exist in the table, the user must be redirected to the home page else user must be redirected to the Registration page.
Tried the branching concept:
Branch Point: On Load: Before Header
Condition: NOT Exists (SQL Query returns no rows)
Expression1 : select * from users_tab where name = v('APP_USER')
When this condition is given, though the user name does not exist in the users_tab, the page is redirected to page 1 instead of the Registration page.
Where is the problem here?
How can it be resolved?
Is there an alternative way to implement this?
Edited by: 935799 on Jun 7, 2012 6:51 AM

935799 wrote:
Hi,
Have a requirement where when a user log into the application, the APP_USER must be checked against the list of users maintained in a database table, if APP_USER name exist in the table, the user must be redirected to the home page else user must be redirected to the Registration page.
Tried the branching concept:
Branch Point: On Load: Before Header
Condition: NOT Exists (SQL Query returns no rows)
Expression1 : select * from users_tab where name = v('APP_USER')
When this condition is given, though the user name does not exist in the users_tab, the page is redirected to page 1 instead of the Registration page.
Where is the problem here?
How can it be resolved?
Is there an alternative way to implement this?
Edited by: 935799 on Jun 7, 2012 6:51 AMThe above should work, try this
select * from users_tab where upper(name) = nvl(:APP_USER,'X')

Similar Messages

  • How to redirect to different page after login in APEX 4.1

    Dear All,
    Here my Requirement is,When the users login,
    when they entered their username and password and pressed login button,
    they have to redirected to different pages based on the type of user.
    Here my LOGIN_TABLE has following 3 columns,
    1.Username
    2.Password
    3.Type.
    The TYPE has 2 values, employee and admin.
    when the type is admin they should be redirected to page 2,
    reaining i.e employee users has to be redirected to page 3.
    How can I do this? please give some suggestion.
    Thank you.
    regards,
    Gurujothi

    Dear Christian,
    Thank you for your reply,
    I would like to explain something,
    When I using the following function,
    *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;*
    When login, It checks in the login_table table and if the username is exist with the pass word it successfully entered inside the application.
    for all users only one page which we set.
    My Login_table also contains type which has 2 type as I mentined above.
    But As I mentioned earliar based on the user type it has to be redirected to 2 different page.
    I found this Package but I cant understand,Can you please Explain?
    *create or replace PACKAGE app_security_pkg
    AS
    PROCEDURE add_user
    p_username IN VARCHAR2
    ,p_password IN VARCHAR2
    PROCEDURE login
    p_uname IN VARCHAR2
    ,p_password IN VARCHAR2
    ,p_session_id IN VARCHAR2
    ,p_flow_page IN VARCHAR2
    FUNCTION get_hash
    p_username IN VARCHAR2
    ,p_password IN VARCHAR2
    RETURN VARCHAR2;
    PROCEDURE valid_user2
    p_username IN VARCHAR2
    ,p_password IN VARCHAR2
    FUNCTION valid_user
    p_username IN VARCHAR2
    ,p_password IN VARCHAR2
    RETURN BOOLEAN;
    END app_security_pkg;*
    *create or replace PACKAGE BODY app_security_pkg
    AS
    PROCEDURE login
    p_uname IN VARCHAR2
    ,p_password IN VARCHAR2
    ,p_session_id IN VARCHAR2
    ,p_flow_page IN VARCHAR2
    IS
    lv_goto_page NUMBER DEFAULT 1;
    BEGIN
    -- This logic is a demonstration of how to redirect
    -- to different pages depending on who successfully
    -- authenticates. In my example, it simply demonstrates
    -- the ADMIN user going to page 1 and all other users going
    -- to page 2. Add you own logic here to detrmin which page
    -- a user should be directed to post authentication.
    IF UPPER(p_uname) = 'ADMIN'
    THEN
    lv_goto_page := 1;
    ELSE
    lv_goto_page := 2;
    END IF;
    APEX_UTIL.SET_SESSION_STATE('FSP_AFTER_LOGIN_URL');
    wwv_flow_custom_auth_std.login
    p_uname => p_uname,
    p_password => p_password,
    p_session_id => p_session_id,
    p_flow_page => p_flow_page || ':' || lv_goto_page
    EXCEPTION
    WHEN OTHERS
    THEN
    RAISE;
    END login;
    PROCEDURE add_user
    p_username IN VARCHAR2
    ,p_password IN VARCHAR2
    AS
    BEGIN
    INSERT INTO app_users (username, PASSWORD)
    VALUES (UPPER (p_username),
    get_hash (TRIM (p_username), p_password));
    COMMIT;
    EXCEPTION
    WHEN OTHERS
    THEN
    ROLLBACK;
    RAISE;
    END add_user;
    -- Function to Perform a oneway hash of the users
    -- passwords. This cannot be reversed. This exmaple
    -- is a very week hash and if been used on a production
    -- system, you may want to use a stronger hash algorithm.
    -- Read the Documentation for more info on DBMS_CRYPTO as
    -- this is the supported package from Oracle and
    -- DBMS_OBFUSCATION_TOOLKIT is now depricated.
    FUNCTION get_hash (p_username IN VARCHAR2, p_password IN VARCHAR2)
    RETURN VARCHAR2
    AS
    BEGIN
    RETURN DBMS_OBFUSCATION_TOOLKIT.md5 (
    input_string => UPPER (p_username)
    || '/'
    || UPPER (p_password));
    END get_hash;
    PROCEDURE valid_user2 (p_username IN VARCHAR2, p_password IN VARCHAR2)
    AS
    v_dummy VARCHAR2 (1);
    BEGIN
    SELECT '1'
    INTO v_dummy
    FROM app_users
    WHERE UPPER (username) = UPPER (p_username)
    AND PASSWORD = get_hash (p_username, p_password);
    EXCEPTION
    WHEN NO_DATA_FOUND
    THEN raise_application_error (-20000, 'Invalid username / password.');
    END valid_user2;
    FUNCTION valid_user (p_username IN VARCHAR2, p_password IN VARCHAR2)
    RETURN BOOLEAN
    AS
    BEGIN
    valid_user2 (UPPER (p_username), p_password);
    RETURN TRUE;
    EXCEPTION
    WHEN OTHERS
    THEN RETURN FALSE;
    END valid_user;
    END app_security_pkg;*
    And you said "assign an URL to FSP_AFTER_LOGIN_URL, depending on the Type column",
    Where to assign,Could you please Explain?
    Thank you.

  • How to redirect to other page in a dialogListener?

    Hi All,
    I am using JDeveloper 11g with ADF BC.
    How to redirect to another page from a dialogListener of <af:dialog>?
    I have a page with a [Delete] button on it. When user click on the delete button, a confirmation dialog will appear to ask "Are you sure? [Yes/No]". If user answer [Yes], I will delete the current record, and go to another page. I can call a Operation Binding in the dialogListener, but I don't know how to go to another page.
    public void handleDeleteDialog(DialogEvent dialogEvent) {
    OperationBinding operationBinding = bindings.getOperationBinding("Delete");
    Object result = operationBinding.execute();
    if (!operationBinding.getErrors().isEmpty()) {
    // redirect to another page?
    Regards,
    Samson Fu

    Hi Samson,
    Check following link for your query:-
    Re: page has to navigate to the next page when  clicking button in the popup
    You can also make usae of Navigation Handler to invoke the navigation action in your task flow as
    FacesContext facesCtx = FacesContext.getCurrentInstance();
    NavigationHandler nh = facesCtx.getApplication().getNavigationHandler();
    nh.handleNavigation(facesCtx, "", "ActionNameInTaskFlow");
    Vikram

  • How to redirect a JSP page after the session is killed

    Hello!
    I am quite new to JSP. I have a question about how to redirect a jsp page after the session is killed. Could anyone help?
    thanks a lot in advance!

    You can't, directly. There's no connection betweenthe server and browser.
    even after invalidating the session. we can do it
    directly using the statement
    response.sendRedirect("....");
    or we can use the meta refresh tag.if session is invalidated and if we try to do response.sendRedirect(".. ") it throws IllegalStateException

  • How can I rearrange the pages in a PDF without changing the assigned paged numbers.

    How can I rearrange the pages in a PDF without changing the assigned paged numbers? These correspond to the original document folio numbers.

    In theory it would be possible to 'record and play back' the page numbers using a folder-level script, but it's far from trivial. You would have to use the doc.movePage() function - presumably driven by a dialog box - to do the page shuffling so there was a way to track what was being done, then swap the page 'labels' of the two affected pages. That's where it gets messy.
    We have functions in the JSAPI which can read and write the page label, but they don't do things in a logical way. The 'getPageLabel()' function simply returns a string, but the 'setPageLabel()' method expects to be told the numbering scheme, prefix, etc. You'd have to parse the string and work out what scheme it was implementing.

  • How do I create and use a ringtone without syncing and without jailbreaking?

    How do I create and use a ringtone without syncing and without jailbreaking?

    You create ringtones on your computer and sync them to your iphone.
    You can buy ringtones from the ringtones section (at the bottom of the screen when you open itunes) of the itunes app on your iphone.
    There may be apps that will do this - not sure.

  • How do I set up pages for mac and ipad to share a document and keep them synced.

    How do I set up pages for mac and ipad to share a document and keep them synced.

    You can upload them from Mac to iCloud and then download on the iPad. They only directly sync between iOS devices. The Mac version of Pages has more options that are not available on iOS. If you use a font that is not available on iOS it will change the font. Some layout options aren't available either.

  • What is the procedure for a hard boot of my iPod touch 4th generation without itunes, and without computer, and without iPod data screen.?

    What is the procedure for a hard boot of my iPod touch 4th generation
    without iTunes, and without computer, and without iPod data screen?
    6 months after purchase I updated my iPod touch as recommend by iTunes.
    It has not worked since that day.  It frozen (disabled) with a "connect to
    iTunes" icon displayed...that is the only thing it does.  itunes does not
    recognize the iPod.  My Windows7 computer recognizes an Apple device. 
    Other computers recognize the devise but if iTunes resided on that
    computer it did not recognize the iPod
    I suffered a setback with deep depression and am just now getting out of it enough to do something.  The depression prohibited me from taking action.
    I have done every procedure recommended from Apple help and external
    sources.  I did this thoroughly with help for other owners and IT experts,
    Apple employees etc etc.  I and associates have perform reboots utilizing a
    number procedure using only button on the iPod.  These were unsuccessful
    also have performed.
    Please do not ask me to do the usual.
    Online I saw  a process using the buttons on the iPod to completely
    reformat 
    the iPod.  It was NOT the hold buttons for 10 sec let go of one wait 8 sec
    etc.  I can not find the process now...a friend showed it to me in passing
    I have lost contact with him.  This is the procedure, I believe, that with
    enable me to update and use the iPod. 

    You need an internet connection and likely a computer with iTunes but an iPhone, iPad or iPod touch with the FindMy iPhone App may work by:
    If you previously turned on FIndMyiPod on the iPod in Settings>iCloud and wifi is on and connected go to iCloud: Find My iPhone, sign in and go to FIndMyiPhone and use Remote Wipe to erase the contents of your device. If you have been using iCloud to back up, you may be able to restore the most recent backup to reset the passcode after the device has been erased.
    You can also wipe the iOS device by installing the FindMyiPhone app on another iOS device and using that app to wipe the device.
    Otherwise
    Disabled
    Place the iOS device in Recovery Mode and then connect to your computer and restore via iTunes. The iPod will be erased.
    iOS: Forgot passcode or device disabled
    If recovery mode does not work try DFU mode.                        
    How to put iPod touch / iPhone into DFU mode « Karthik's scribblings        
    For how to restore:                                                             
    iTunes: Restoring iOS software
    To restore from backup see:
    iOS: Back up and restore your iOS device with iCloud or iTunes       
    If you restore from iCloud backup the apps will be automatically downloaded. If you restore from iTunes backup the apps and music have to be in the iTunes library since synced media like apps and music are not included in the backup of the iOS device that iTunes makes.
    You can redownload most iTunes purchases by:           
    Downloading past purchases from the App Store, iBookstore, and iTunes Store        
    If problem what happens or does not happen and when in the instructions? When you successfully get the iPod in recovery mode and connect to computer iTunes should say it found an iPod in recovery mode.
    Yo may have to go to an Apple store or a friend's house with an internet connection and iTunes.

  • Data fetch from table without Refresh and without using tab key.

    hi Friends,
    I have a problem i want to extract data from table without Refresh into text field without using Tab key. when i'll enter any value in a text field then corressponding value should come in to corressponding textfield without using Tab Key.
    eg. when i enter emp_id 101 in a text field then the first_name and last_name ,adress should come in to corressponding text fields without refresh and without using Tab key.
    How Can I do this.
    Thanks
    Manoj

    Hi Manoj,
    I assume that this is similar to: Data fetch without Refresh rather than Re: Value of one textfield should come into another textfield Without Using TAB ?
    If so, the only change you need to make on the first one is to use "onkeyup" instead of "onchange" in the item's "HTML Form Element Attributes" setting.
    Note, however, that the user must move away from the item at some point (for example, to click a button), so the onchange will be triggered anyway.
    Andy

  • Iphone without contract and without sim LOCK

    hi, can I buy the iphone without contract and without sim LOCK?? if then where, for information binn I sechr gratefully. greeting

    Actually, you don't HAVE to sign a two year contract with AT&T, you can use the GO Phone option and do a month-to-month payment.
    The drawback to that is that for your $50/month you get less than half as many minutes and no pre-paid SMS. You do, however, get unlimited internet turning your iPhone into a miniature laptop that you pay way too much to use each month... grin
    I'm on the GO Phone option until my stupid T-Mobile contract expires later this year...

  • How to redirect to a page after login fails?

    Since I am working on an automated login from Forms I would like the login page to redirect to an error page if the login fails. I can't seem to find an option for this.
    I am using a public page that branches to 101 with BRANCH_TO_PAGE_ACCEPT, but when login fails I see this login page.
    Instead of that I would like to redirect to a public page that shows a message.
    How can I do this?
    Wendy

    A login failure is when the user and/or pass is not correct. I do not want to show page 101 but a different page when this happens.
    I am using the default login page but I am calling it with BRANCH_TO_PAGE_ACCEPT so the user never sees it and I want to keep it that way....

  • How to redirect a jsp page?

    Hi
    I have two jsp pages called submit.jsp and save.jsp.In the submit.jsp page
    I wrote the following code
    <form name= Submit action=save.jsp>
    <input type=Submit name=save value=save>
    whn i submit save .jsp page is opend and will dispaly a message saved the data.Now wht i want is after the save.jsp page is opened the page should be automatically redirected in 3 seconds to submit.jsp that is the first page.How can i dothis.Pls give me some code.
    Thanks

    Something like...
    <META HTTP-EQUIV="Refresh" CONTENT="3; URL=your.jsp">
    in your <head> tag where 3 is the number of seconds to wait.

  • How to Redirect to a page From a link in Header.

    Hi , I have a link in the Header.jsp to Contactus page. How to navigate to that page From header.jsp.
    Can any one please help me on this

    User render:pageUrl tag
    http://download.oracle.com/docs/cd/E13155_01/wlp/docs103/javadocjsp/framework/render/pageUrl.html
    I assume you mean that you wish to goto the page and not a 'redirect'

  • How to Redirect to other page

    Hi,
    i have a select list and a button, when i click the button, i would like it to follow the selection from the select list and redirect to different page. I have total 2 pages, page 1 and page 2. I created a selected list named "P2_GROUPBY", and a button named "Filter".
    And i create a process to cater the logic of it.
    {color:#333399}begin
    case
    When :P2_GROUPBY = 'PRDFML' then{color}
    {color:#008000}-- Code i should redirect to page 2{color}
    {color:#333399}When :P2_GROUPBY = 'FAMILY' then{color}
    {color:#008000}-- Code i should redirect to page 3{color}
    {color:#333399} end case;
    end;
    {color:#000000}Please help me with this matter,
    Thank you.
    Best Regards
    Vincent.
    {color}{color}

    Varad,
    Thank you for the suggession, i did try your method, and i created a process to set the setting, somehow, the page still post back to the original page.
    my Process:
    page1
    {color:#000080}Begin
    if :F117_PAGE is not null then{color} {color:#008000}-- :F117_Page is application item so i do not need to created in other page.{color}
    {color:#000080}:F117_PAGE := '';
    end if;
    {color}
    {color:#000080} case
    When :P2_GROUPBY = 'PRDFML' then
    :F117_PAGE := 2;
    :P2_TESTING := :F117_PAGE;
    When :P2_GROUPBY = 'FAMILY' then
    :F117_PAGE := 3;
    :P2_TESTING := :F117_PAGE;
    end case;
    end;
    {color}
    *{color:#000000}Branching to URL identified by Item.*
    *{color}*After the process, this branch will trigger by the "filter" button, and go to that particular page.
    I put branch action to:
    :F117_PAGE
    Somehow, the page still redirect to the current page.
    ~Vincent.

  • 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

Maybe you are looking for

  • ERROR ON INSTALLATION PROCESS!!!

    please could someone help me!!! i already have iTunes and was trying to download the new version (7.0). i got through to the main download process with the iPod ad on it and then an error comes up with something about quicktime and the eroor code HRE

  • Buggy Brush Behavior in Photoshop CS5 / Lion

    I have a problem that has suddenly appeared in Photoshop CS5 (current version 12.0.4). Using it on a recent MacBook Pro. I am running this under Lion, and have been doing so ever since I installed the new system (about a week or two after Lion was re

  • NI PCI-MIO-16XE-50 voltage output

    I am an undergraduate student working on a research project. I need to program a labview block diagram to output continous voltage using DAQ NI PCI-MIO-16XE-50. I am new to this and having problems with formulating. For example, if i need to output 4

  • Simple list

    Hello, I have a problem with a simple list and maybe someone could help me. I have a simple list, created with classical WRITE statements. In foreground mode everithing is OK, but when I run the report in background mode, I have an extra line in my l

  • Calendar replication and fonctionalities don't work on BB 8310

    Hi All, I have a Blackberry 8310  version 4.5.0.55. I'm connected to a BES server running a Lotus Dominio 6.53 server. My mailbox is located in a Domino 8.51 server. My problem is that calendar entries are not replicated. Mail replication works well