Navigate from one page to another programmatically

Hello

12.1.3 Jdev

I want to navigate from one page to another on a button click.

I used the below code 2 and both works fine. I wanted to know what the difference is in the present and what is the best practice.

#1

        FacesContext context = FacesContext.getCurrentInstance();
        Application app = context.getApplication();
        NavigationHandler handler = app.getNavigationHandler();
        handler.handleNavigation(context, null, "goHome");

#2

        String loginUrl = "/adfAuthentication?success_url=/faces/home.jsf";
        FacesContext ctx = FacesContext.getCurrentInstance();
        HttpServletRequest request = (HttpServletRequest) ctx.getExternalContext().getRequest();
        HttpServletResponse response = (HttpServletResponse) ctx.getExternalContext().getResponse();
        RequestDispatcher dispatcher = request.getRequestDispatcher(loginUrl);
        try {
            dispatcher.forward(request, response);
        } catch (ServletException se) {
            reportUnexpectedLoginError("ServletException", se);
        } catch (IOException ie) {
            reportUnexpectedLoginError("IOException", ie);
        }
        ctx.responseComplete();

See you soon

AJ

You can use the actionListener to the button for the action before the navigation and the action itself do navigation.

Timo

Tags: Java

Similar Questions

  • How to remove white screen when you navigate from one page to another in Webworks BB?

    Hi all

    I have developed a web application for Blackberry using Blackberry webworks SDK... I created the package using emulator Ripple... In that when you navigate from one page to another page... coming white screen... How to remove this white screen... and instead of the definition of the loading screen in web application... Please me... Thank you very much in advance...

    With respect,

    Marimuthu_P

    normally it is not a white screen to navigate. You can view data-bb-effect as "bland" for the transition to the screen:

    https://github.com/BlackBerry/bbUI.js/wiki/screens

    second thing, is to use the activity indicator for loading (pending content):

    https://github.com/BlackBerry/bbUI.js/wiki/activity-indicator

  • How to navigate from one page to another page.

    I'm trying my hands on Flex by building a sample application.

    After the user connects I want it to be on the home page. So in Flex how to navigate from one page to another on certain conditions?

    A way I thought is to make invisible visible n components, but which does not seem a good idea.

    What approach allows us to reach this goal?

    Please suggest.

    For your scenario, you really have to use the ViewStack (do not use States for this).

    Here is a link:

    http://livedocs.Adobe.com/Flex/3/HTML/Help.HTML?content=navigators_3.html

    And here is a very simple code:


    http://www.Adobe.com/2006/mxml">
     
     
       
         
       

       
         
       

       
         
       

       
         
       

     

    If this post answers your question or assistance, please mark it as such.

  • navigate from one screen to another sc

    Hello

    I have a java Application with some screens Developpers.

    each screen is in a different java file.

    I want to navigate from one screen to another screen, but I can't UST copy the following code: Pushscreen (new BilanScreen());

    How can I do?

    Yes, it is expected that pushScreen cannot be called from the class of the screen, as the original method belongs to the UiApplication class... So if you want it to be used in a form, then you should go:

    UiApplication.getUiApplication().pushScreen(new Screen's Instance);
    

    However, before doing so, I suggest you to skip the old screen. This can be done:

    UiApplication.getUiApplication().popScreen(UiApplication.getUiApplication.getActiveScreen());
    

    See you soon...

    Note: Through the thread sticky by tbilisoft, KB articles and videos of developer for effective development...

  • How nagivate values from one page to another page as well assured in different modules like po and pon

    How nagivate values from one page to another page as well assured in different modules like po and pon?

    I tried using the session values, hashmap, and Transaction. But none worked.

    Please help me on this.

    Dilip thanks.

    My problem is solved.

    I solved the issue.using the main concepts of java.

    By importing a package into other package and then instantiate the required class.

    Kind regards

    2793235.

  • Why do I get a minimal movement of my design from one page to another?

    I copied the content from one page to another and then changed some text - when I saw I find design moves a few mm of one page to the other - the design is minimal, so it is really obvious. Thank you

    It's ok - it worked

  • When I copy something from one page to another, it seems to change text color or background, that I do not understand why he never used to do.

    When I copy something from one page to another, it seems to change text color or background, that I do not understand why he never used to do.

    Whether it's text or only a shape it changes its color to something else when I copy and paste on.

    Do you mean 'page' or 'site '?

    If you copy something from another site, the reason may be, to have different, but all also named colours on each site.

    It would be normal and causes the noticed effect.

  • I wish I could drag and drop items from one page to another of the window of the plan. Is this possible?

    In desiging my site, I want to be able to move items from one page to another by drag-and - drop from the flat screen of architecture. It would also help if the window could have a zoom in and out function to facilitate this.

    I just tried to zoom in the map window and discovered that it works.

  • Best way to move data from one page to another within the app

    Hi all as I started to write that and was way to complicated to explain in full without a novel.

    Brief description. I use the query string that begins in the parent (from href in JSON) window must then be moved in the iframe url when moving to other pages to avoid security as a page and iframe is conflicting http and https. and are not accessible... It seems that there must be a better way.

    So my question is what is the best way in a platform open to move data from one page to another?

    You do it this way, it's in the menu.json, but when you work within the iframe and if your loading pages in applications using vairable relative URLS cross they come through.
    Discovered only this framework using the browser and you can se the construction and scope of all URLS used.

    The apps are sandboxed you cannot access aything in the parent frame, this is a feature of derliberate if something you can not do.

    As I said, you have a few methods to your own data storage space.

  • Moving grouped content from one page to another (javascript - InDesign)

    Can someone show a simple solution on how to move a group selected items include the text and graphics from one page to another page in the same document using javascript for scripting InDesign 5.5. Thank you!

    You cannot determine where the item is placed, it is an operation of both parties. If you want to save & restore the original location, try this:

    ypos = app.selection[0].geometricBounds[0];
    xpos = app.selection[0].geometricBounds[1];
    app.selection[0].move (app.activeDocument.pages[1]);
    app.selection[0].move ( [ xpos, ypos] );
    

    This fails on a spread when you try to move something to a page in the left hand to the right hand one or conversely, as by default, InDesign treats spreads as a single unit of basic, no pages - you move your article to the correct spread, but not on the right page, and it seems on the same half of the spread that he was from. If there is a problem, you can experiment with changing the options of rule (by spreading, by page, etc.) and see if it works for you.

  • How to manage the attribute date, passing the parameter from one page to another

    Hi friends,

    I want to spend attribute data from one page to another page-

    I'm passing as below, in the log window jdev I get error below.
    String StatusUpdateDate = row.getAttribute ("StatusUpdateDate");
    params.put ("StatusUpdateDate", StatusUpdateDate)
    Error (121.50): incompatible types. found: java.lang.Object, required: java.lang.String


    Suppose that I'm passing as below, while moving from one page to the other, I am getting error in the application below
    String StatusUpdateDate = row.getAttribute("StatusUpdateDate").toString)
    Date of update of State - Houston-25009: failed to create an object of type: oracle.jbo.domain.Date with value: 26-MAR-2009

    Please you can suggest me how to handle this error.


    Thank you and best regards,
    Vandenplas

    Hello

    Vandenplas

    you're right, this method is to launch error, which is why I got, bcz timstamp is also not implmenting Serializable interface, is there he throwing error at run time

    u just go this way

    another page of request-Destination page Controller-Process-

    Add a new line below the following line

    DATE StatusUpdateDate = (DATE) pageContext.getTransactionTransientValue ("StatusUpdateDate");

    String stringStatusUpdateDate = StatusUpdateDate.toString ();

    and also in your AM CODE

    change your method like this

    public void testselection (String Name, String Email, String product, the string, String StatusUpdateDate)

    hope this will solve the problem

    thanx

    Pratap

  • Take the time to navigate from one field to another field or record to another record.

    Hi all

    We are facing a problem in our forms, when navigate us from one field to another field or move a recording to below the record in the block of retail then it takes 4 to 5 seconds to navigate.

    It's unusual behavior, sometimes it works very well and long takes the time to browse.

    Here's our environment:

    Server configuration:

    Oracle Fusion Middleware 11g (10.3.6)

    Oracle 11 g Release2 forms and reports services

    Oracle Database 11g Release2

    Client side:

    Browser = Internet Explorer (8.0.6)

    Java 7 update 45 (build 1.7.0_45 - b18)

    Kind regards

    Omer

    Questions about the customer like this are typically Java associate.  Have you tried to clear the Java Cache on the affected workstations?

    Craig...

  • Copy layers or pieces of a layer from one page to another, without masters?

    How can I copy layers or pieces of one page to another? I created a master and I want to create a second master who uses much of the same configuration, but I need to go to enter a photo in the background. However, the only quick way to get menus and headers of the first master in the second master is actually the master award, but then I can't move the picture on the back at all. Is there a way I can copy these menus and such in a new master without having that him attributed to the first master?

    In your site map, right click on the mask that you want to use as a second master and choose 'double page'. This will create a new master with all elements of the first master, but can be edited separately from the first menu.

    If I understand what you were trying to do this should work for you.

  • How to navigate from one stream to another taskflow task

    How do to navigate from one task flow to another example of taskflow.for in taskflow one I will be clicking on a button that takes me to another taskflow

    I'm happy to help, just mark the thread as a response to other readers.

    Pedja

  • Cyan fails from one page to another on Officejet Pro K8600

    I have an Officejet Pro K8600, installed on XP. A nearly full cyan stopped working in the middle of printing from one page to the other - tried all the patches.  No msg error - says all cartridges are full. Buy HP new cartridge, always did the same thing. I uninstalled and reinstalled this morning. First page of diagnostics showed labour cyan on the first block, broken on the second line. Then would not work again at all. Do I need a new print head? The health of the print head shows that both are OK. Thank you! Very frustrating. It's a good printer!

    The Officejet Pro K8600 has ink cartridges that are separated from the print head Assembly.  The pipes of the unit ink cartridges in the front lower left of the printer internal for the print heads.  With this type of printing mechanism, a print quality problem, for example a missing color, usually resides in the printheads of the unit.

    I'll try to run 3 levels of the print head cleaning utility in the part of the Toolbox of the software for this printer.  Thus, there is a document with steps to help solve a problem of print quality in the K8600.  The document can be accessed here.

    Let me know how it goes.

Maybe you are looking for