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

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 Link another JSP Page in the same portal component

    Hi Guys,
      I am a new guy to SAP, currently, I want to add href link to another JSP in the same component, so I used <a href="<%=webpath%>/jsp/AboutPage.jsp">, but obviously, the link can not display target page due to privilege restriction, does anyone know how to resolve this problem? thanks very much!
      Best Regards
      James

    Thanks srinivas,
       Sorry for late response, too busy yesterday.
       Currently, I want to create a URL link in the page which links another JSP page in the same portal component, but the problem is this JSP page is under PORTAL-INF folder, so due to privilege problem, I can not create the link like the following:
    <a href="jsp/test.jsp">Link</a>
       I konw if I move test.jsp out of folder PORTAL-INF, the above way should work, but then, I found the JSP page can not access componentRequest and get resource bundle object.
      Am I clear, please let me know, thanks!
    Regards.
    James

  • 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 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 in java code not the jsp or any other

    hello
    can any one help me how to redirect in java pages the code must be in java function not in jsp or any thing else
    thanks in advance

    Function? Don't you rather mean method?
    Anyway, in JSF you can send a redirect using ExternalContext#redirect(). If your JSF environment is on top of JSP/Servlet, then under the hood it basically invokes HttpServletResponse#sendRedirect() and FacesContext#responseComplete().

  • How to call required page after the am.invokermethod is called.

    Hi All,
    I have a serch page which search the table ABC and returns the results(Standard functionality). I results table will have update icon. Now when the update icon, i will pass param mid = 100, is clicked I need to check the table MST whether it has records with mid=100. If yes, i need to display the details by calling the MSTPG page. If no, need to call other page called MSTTEMPPG.
    So, How do i check the record exists in the table or not and call the appropriate page.
    If i use am.invokermethod(), it call the procedure and executes but this method doesnot return values.so that based on the return value i can call the required page.
    Thanks,

    Thanks Senthil for the response.
    I Just wanted to keep the question simple and that is not all the requirement.
    I know the switcher bean concept i'm sure that it may not meet my requirements.lets keep it a side.
    But sure the second point you mentioned. To redirect to page based on the return value should help me can you elobrate / how do i call a page from the AM.
    1) Does am.invokermethod() - returns a value.
    2) If no, The procedure AM invokes should have the redirect method - what is the method and how do i call the page from AM
    Thanks
    Ganesh.

  • How do I spot a command in pages after the app has locked up?

    how do I spot a command in pages after the app has locked up?

    I am not sure what you mean by "spot a command" but in any case this question would likely be better lodged in the iWork Discussion.

  • How to integrate BIBean JSP page with Portal after deploying to iAS?

    Hi all,
    Right now we can deploy a JSP page contains BI Bean crosstab to iAS and can display the page using this url: http://xxx.xxx.xxx.xxx:7779/Application2/Analyze1.jsp.
    BIBean version: 10.1.2.0.2
    JDEV version: 10.1.2.1.0
    iAS version: 10.1.2
    Then according to a sample: http://otn.oracle.com/products/bib/htdocs/samples/samples_overview.html
    , we should test PDKProviderAdapter, but we don't know how to create a provider for it. In the sample project "Portal" I can find a "provider" floder contains provider.xml under the "web content" node.
    My question is : how to create the provider? which document or example can we refer to for help. Eagerly waiting for help.
    Thanks in advance.
    Scott

    thnx for your response.
    Basically we need to develop few JSP pages and that will insert data into the Oracle tables. These tables will hold user information for further processing. Now the requirement is to call these JSP pages from OBI dashboard. We can easily call the JSP pages if OBI runs on OC4J (that we have checked). But in our production environment we are having IIS server to run OBI. So our concern is how to deploy these JSP pages on IIS server?

  • Wrong JSP page in the Browser text field

    Hi,
    I'm using Glassfish as JSF Container and have some strange problem with JSF navigation.
    The navigation itself works but according to the JSF spec the browser address field should stay the same for all pages/outcomes if 'redirect' is not specified. In my case it's somehow populated by previosly loaded page name.
    For example: if browser initially showed the http://server/faces/page1.jsp and as a result of "dopage2" outcome Glassfish generated and sent the page2.jsp - everything is fine - it is properly rendered and address field contains the same http://server/faces/page1.jsp, but after the outcome "dopage1" was sumbited and processed from page2.jsp - the page1.jsp is rendered properly but address field contains http://server/faces/page2.jsp, so it changing and changing not correctly (for another outcome lets say "dopage3" sumbited from page1.jsp there will be http://server/faces/page1.jsp - always late by one submit).
    If anybody have some idea why is it changing the address bar, - it will help a lot.
    Thanks,
    Dmitry.

    Actually there is nothing in the spec about the browser address field...
    I believed it should be there because it is outlined in the Core JSF book. There is whole chapter about 'redirect' saying the browser address field should stay the same during the JSF session if no redirect was specified.
    So, If it is the expected behavior, is not confusing for the user to see the http://server/page1.jsp in the addressfield when page2.jsp is actually displayed?

  • How to run a jsp page

    hello to all of u
    i m bit comfortable with SERVLET and please tell me that how to run a JSP page.i m using TOMCAT.
    someplace it is written that " write the program ,save under the root of tomcat i.e in my system it is tomcat 4.1 and to store in tomcat4.1\helloworld.jsp ,,, and then after start the server write in the url --:
    http://localhost:8080/hello.jsp.
    but it is giving error while running.please tell me the procedure.
    thank you
    bye

    Why oh WHY do you want to fiddle with the server.xml file?
    You don't need to.
    Under tomcat is a directory called "Webapps"
    This is where you put your web applications.
    You will see there is an existing one there called ROOT - which funnily enough is the root one used for Tomcat.
    If you put your hello.jsp in the ROOT directory, http://localhost:8080/hello.jsp will work.
    However it is not recommended to use the ROOT directory. Make your own one.
    Create a new directory in the "Webapps" directory eg "test"
    Put your jsps in here.
    under test create a directory called "WEB-INF"
    Copy the web.xml file from [TOMCAT_HOME]/webapps/ROOT/web-inf into the new web-inf directory.
    Now go to http://localhost:8080/test/hello.jsp
    Cheers,
    evnafets

  • You have been redirected to this page because the requested url is invalid.

    When I tried to update my profile in the Apple career web site, I always got the following error: "You have been redirected to this page because the requested url is invalid."  Does any one know how to fix this problems? I have tried 10 times in different browser - chrome, firefox, IE, Safari/Macbook.

    I just updated my wife profile under "https://jobs.apple.com" and it succeed. I'm not sure when update profile and click Confirm button, what apple server try to do. Are they try to match user information or ...?
    I still cannot update my profile. Any one know what's going on after click Confirm button?

  • How to open a JSP page from a form ??? plz help

    hi ..
    i want to know how to open a jsp page from a oracle apps form using a button .
    the requirement is that whenever we click on the button created on the form, it opens a jsp page.
    plz help me ..its urgent !! :-(

    In portlet project, to navigate between pages, you should not use the URL property to link to a page. Instead, portlets use navigation via action handling. You use the Page Navigation editor to set up links to pages; that is, the navigation editor sets the action property.
    Here is an example to hyperlink ans button to open a new page:
    # From within the IDE, create a new portlet project. This action creates the project and one page, PortletPage1.jsp.
    # Create a second portlet page, called PortletPage2.jsp, for the project.
    # Drop a Hyperlink component onto the first portlet page, PortletPage1. (You can drop the Hyperlink on the page in the Design window or on the PortletPage1 node in the Outline window.) Change the Hyperlink's text property to Next Page.
    # Drop a Button component (found in the Basic section of the Palette) onto the second portlet page, PortletPage2.
    # Open the Page Navigation Editor. It displays the two pages (PortletPage1.jsp and PortletPage2.jsp) of the application.
    # Click the PortletPage1.jsp icon in the Navigation window to expand it, and then drag a connector from hyperlink1 to PortletPage2.jsp. Change the name of the connector from case1 to Page2.
    # Click the PortletPage2.jsp icon in the Navigation window to expand it, and then drag a connector from button1 to PortletPage1.jsp. Change the name of the connector from case1 to Page1.
    # Run and deploy the portlet. The browser displays PortletPage1 and you should see the Next Page hyperlink. When you click the Next Page hyperlink, the Apache Pluto Portal server displays PortletPage2. Click the Page2 button to return to PortletPage1.
    Sherry
    Creator Team

  • How to call a jsp page from oaf and run in jDeveloper

    Hi all,
    I created sample jsp and then tried.
    String temp = "sample.jsp?";
    pageContext.setForwardURL(temp,
    null,
    OAWebBeanConstants.KEEP_MENU_CONTEXT,
    null,
    null,
    true,
    OAWebBeanConstants.ADD_BREAD_CRUMB_YES,
    OAWebBeanConstants.IGNORE_MESSAGES);
    It worked.
    But when i tried with one of the custom page that i downloaded from server it is giving error.
    But now i need to call that page.
    Its Code is given on below link:
    Re: how to call a jsp page from oaf
    Please help me to do this.
    Thanks in advance.
    Regards,
    Raj

    Raj,
    1. Hope you have placed the custom jsp page (which you have downloaded from server) under "jdevhome\jdev\myhtml\OA_HTML" directory ?
    2. Try to run the custom jsp page from Jdeveloper directly and check whether its working properly or not ?
    (i.e. add jsp page to any project in Jdeveloper then right click on jsp page and select Run xxx.jsp)
    3. If page errors out then custom jsp page seems require few parameters to run it successfully. Pass all requied parameters and test.
    4. There is no problem in the way you are calling jsp page from OAF page.
    regards,
    Anand

  • How to call a JSP page from Applications menu?

    Hi partners,
    I am still looking for "how to call a JSP page from Applications menu?", I mean instead of calling a form, I want to call a JSP page which is staying in a OC4J repository which is located in another server.
    Any idea will be really appreciated.
    Thanks in advance.
    Frank Mtz.

    Hi Frank,
    if u know the solution please share it with me. i'm looking for the same scenario.
    thanks in advance,
    anish

Maybe you are looking for