ADF:How to use NavigationHandler in Phase-Listener with adfc-config.xml

Hi,
in our application a user should be navigated to the login-page, when he tries to navigate directly to a page where he has no right for or if the session is expired.
Our navigation is complete in the adfc-config.xml. So I created a phase-listener, which is called by the adf-settings.xml.
Inside the phase-listener I'm checking the rights. If the user doesn't have the needed rights, he should be linked to the login page. But how can I do that?
Some days ago our navigation has been complete in the faces-config.xml. But now we moved the navigation to the adfc-config.xml, because we are sure that it's better. E.g. for using the dialog framework.
In the face-config.xml we had also the call of the phase-listener. There we did the forwarding like this and it worked:
FacesContext facesContext = FacesContext.getCurrentInstance();
facesContext.getApplication().getNavigationHandler().handleNavigation(facesContext, null, "login_page");But now I think I have to use the ADFContext somehow, or?
So how can I do that with the adfc-config.xml?
Thanks a lot for your help,
Bastian
I'm using JDeveloper 11g Release 1 (11.1.1.3.0)

Hello Frank,
thanks for your answer, but it doesn't really help me, because I'm a newbie, sorry.
Does your answer mean, that I should leave the call of the phase-listener in the faces-config and then I would also have access to the login-page, which is in the adfc-config?
Or does it mean, that I call now my phase-listener by adf-settings but don't have to change the phase-listener itself and can still use my code (FacesContext...)? But that's not working. I get no error but he is also not redirecting.
Maybe my problem starts on an earlier point.
Is it better to create all pages in the adfc-config or faces-config? (Maybe you have a good reference for reading about such a basic discussion)
I thought adfc-config would be the better one. But there I'm not able to redirect to another page (login) if somebody calls a special page without rights for example.
So my second basic question would be about the relation of adfc-config, faces-config and ADFContext and FacesContext.
Because I think it's not a short answer I hope you could give me also for this a reference so that I can read these basics myself.
Thanks a lot for helping a newbie becoming better :-)
Bastian

Similar Messages

  • How to use URL in actionscript  Instead of services-config.xml?

    Hi Alls,
    I would like to set my service's url in actionScript (I don't
    want to use compiler option -services witch need to recompile swf
    if you change service's url).
    I search for a long time on google but I found nothing, and
    adobe documentation isn't very clear.
    Thank for help!!!

    If you are relying on a services-config.xml file, then this
    must be provided
    at compile time because the compiler uses it to generate
    code.
    If you're not using <mx:DataService>, you can actually
    avoid compiling against
    a services-config.xml file. This is because for the other
    services, such
    as <mx:RemoteObject> or <mx:WebService
    useProxy="true"> or <mx:HTTPService
    useProxy="true">, the main thing the compiler does from
    services-config.xml
    is to generate the code to instantiate the set of channels
    that should be
    used to contact a destination in LCDS.
    Well... you can do that programmatically in ActionScript...
    something like
    this:
    import mx.messaging.ChannelSet;
    import mx.messaging.channels.AMFChannel;
    private function channelInit():void
    var channelSet:ChannelSet = new ChannelSet();
    var channel:AMFChannel = new AMFChannel(null, "
    http://{server.name}:{server.port}/mycontext/messagebroker/amf");
    channelSet.addChannel(channel);
    myRemoteObject.channelSet = channelSet;
    Just make sure you call this initialization code before you
    make any service
    requests. If you're proxied WebServices, be sure that you use
    the ActionScript
    API instead of the MXML tag so that you can delay when
    loadWSDL() is called
    because you'll want to setup the channelSet first.
    Regards,
    Pete
    Hello FredFlex,
    > Hi Alls,
    >
    > I would like to set my service's url in actionScript (I
    don't want to
    > use compiler option -services witch need to recompile
    swf if you
    > change service's url).
    >
    > I search for a long time on google but I found nothing,
    and adobe
    > documentation isn't very clear.
    >
    > Thank for help!!!
    >

  • Use of JSF Phase Listener?

    There are many many examples of how to 'access' the six phases of the JSF Life Cycle.
    I have a simple page that has two input text fields and one command button.
    I would like to be able to access the contents of the text fields on the page in Phase 2 (APPLY REQUEST VALUES), or other phases. After quite a bit of time I am posting this in the hopes that someone could point me in the correct direction to do this or perhaps someone has a simple example.
    Thanks - Casey

    Code for phase listener, backing bean and output are at the bottom of this note.
    The text field has a Id property of lname. I assume you are referring about using findComponent() against the backing bean that has a corresponding property (RichInputText) for the text field?
    When I run the app I am getting a null for the objReference for the backing bean (line 16 in the output) - see output which then causes a NullPointerException.
    Suggestions on how to get the reference to the backing bean, or the component that will contain the data for the input text field?
    Thanks again - Casey
    The code I am using in the Phase Listener class is:*
    +public class MyPhaseListener implements PhaseListener {+
    +public MyPhaseListener() {+
    +}+
    +public void beforePhase(PhaseEvent pe) {+
    if (pe.getPhaseId() == PhaseId.RESTORE_VIEW)
    System.out.println("Processing new  Request!");
    System.out.println("before - " pe.getPhaseId().toString());+
    +if (pe.getPhaseId().toString().equals("APPLY_REQUEST_VALUES 2")) {+
    System.out.println("lkjhlkjhlkjhlkjh");
    +}+
    +if (pe.getPhaseId().toString().equals("APPLY_REQUEST_VALUES 2")) {+
    FacesContext facesContext = FacesContext.getCurrentInstance();
    ELContext elContext = facesContext.getELContext();
    ExpressionFactory expressionFactory =
    facesContext.getApplication().getExpressionFactory();
    ValueExpression exp =
    expressionFactory.createValueExpression(elContext,
    +"#{BackingBean}",+
    BackingBean.class);
    BackingBean nameData = (BackingBean)exp.getValue(elContext);
    System.out.println(nameData);
    System.out.println(nameData.getLname().findComponent("lname"));
    +}+
    +}+
    +public void afterPhase(PhaseEvent pe) {+
    System.out.println("after - " pe.getPhaseId().toString());+
    if (pe.getPhaseId() == PhaseId.RENDER_RESPONSE)
    System.out.println("Done with Request!\n");
    +}+
    +public PhaseId getPhaseId() {+
    return PhaseId.ANY_PHASE;
    +}+
    +}+
    The code for the backing bean is:*
    package view;
    import oracle.adf.view.rich.component.rich.input.RichInputText;
    +public class BackingBean {+
    private RichInputText lname;
    +public BackingBean() {+
    +}+
    +public void setLname(RichInputText lname) {+
    System.out.println("In setLName");
    this.lname = lname;
    +}+
    +public RichInputText getLname() {+
    System.out.println("In getLName");
    return lname;
    +}+
    +}+
    Output from System.out.println statements:*
    Processing new  Request!
    before - RESTORE_VIEW 1
    after - RESTORE_VIEW 1
    before - RENDER_RESPONSE 6
    In getLName
    In setLName
    after - RENDER_RESPONSE 6
    Done with Request!
    Processing new  Request!
    before - RESTORE_VIEW 1
    In setLName
    after - RESTORE_VIEW 1
    before - APPLY_REQUEST_VALUES 2
    lkjhlkjhlkjhlkjh
    null
    after - APPLY_REQUEST_VALUES 2
    +<Jul 13, 2009 8:27:14 AM CDT> <Error> <HTTP> <BEA-101017> <[weblogic.servlet.internal.WebAppServletContext@857c75 - appName: 'Application8', name: 'Application8-ViewController-context-root', context-path: '/Application8-ViewController-context-root', spec-version: '2.5', request: weblogic.servlet.internal.ServletRequestImpl@1c70722[+
    +POST /Application8-ViewController-context-root/faces/untitled1.jspx?_adf.ctrl-state=793257214_3 HTTP/1.1+
    +Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, application/xaml+xml, application/vnd.ms-xpsdocument, application/x-ms-xbap, application/x-ms-application, application/x-shockwave-flash, */*+
    +Referer: http://127.0.0.1:7101/Application8-ViewController-context-root/faces/untitled1.jspx?_adf.ctrl-state=793257214_3+
    +Accept-Language: en-us,de;q=0.5+
    +Content-Type: application/x-www-form-urlencoded+
    +UA-CPU: x86+
    +Accept-Encoding: gzip, deflate+
    +User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; InfoPath.2; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648)+
    +Content-Length: 269+
    +Connection: Keep-Alive+
    +Cache-Control: no-cache+
    +Cookie: JSESSIONID=wBr1Kb2GrCDpnhkNNgQyTvJvSjlnWHyvnq9gNWT92kvsFYlGC1Jl!1059440035+
    +]] Root cause of ServletException.+
    java.lang.NullPointerException
    +     at view.MyPhaseListener.beforePhase(MyPhaseListener.java:42)+
    +     at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:228)+
    +     at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:175)+
    +     at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)+
    +     at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)+
    +     Truncated. see log file for complete stacktrace+

  • How do I set a Phase Listener to only run for a specific page?

    How do I set a Phase Listener to only run for a specific page?
    I understand that a Phase Listener runs for ever page in the application, however I want a phase listener to only run for one page at the beginning of the application.
    I discovered I can't use a Filter, because the JSF Application instance always returns null.
    Thus, I thought a Phase Listener would be a good approach.
    Thoughts?
    Thanks,
    --Todd                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    I have moved forward with checking the requested URI...
    (shivers)
    Thanks,
    --Todd                                                                                                                                                                                   

  • How to use the same OC4j server with different port number

    How to use the same OC4j server with different port numbers..?
    I have to OC4J installed on my machine on different hard disk drives....
    I want to be able to run both the server simultaneously..?
    is it possible ..it yes then how..?
    for that i have changed the port number of one server...
    but when i am trying to start the other server with different port number..it says that JVM -Bind already...
    Is there any clues...?
    Nilesh G

    In the config directory:
    default-web-site.xml: Change the port the HTTP listener listens on
    jms.xml: Change the port the JMS service listens on
    rmi.xml: Change the port the ORMI listener listens on.
    Or, you can add another web-site.xml file, and deploy your applications to 1 server, and bind the web applications to the different web sites. This way you only have to deploy your applications to 1 place.
    Rob
    Oracle

  • How to use "Notes" on my iPad with my existing iCloud address?

    How to use "Notes" on my iPad with my existing iCloud address? It asks me to create a new one...

    Did I overlook some critical info here? I'm having the same problem described by Henry5, but I'm signed in to iCloud with my AppleID which is not the same as my Mobile Me/iCloud email. I keep being asked to create an account (which it won't allow me to do since the account already exists) but no where do I see an option to use the existing account. I also tried logging out with my AppleID account, and using the iCloud email, but that doesn't work.
    I just want to sync my notes and mail... this is really irritating!

  • How to use FM SO_DOCUMENT_REPOSITORY_MANAGER send mail with CC.

    Dear Experts:
    Please help me. How to use FM SO_DOCUMENT_REPOSITORY_MANAGER send mail with CC.
    My Program code is as follow:
    *Send the mail.
    tb_receipients-recnam = 'BAITZ'.
    tb_receipients-recesc = 'B'.
    tb_receipients-sndex = 'X'.
    tb_receipients-att_fix ='X' .
    APPEND  tb_receipients.
    CALL FUNCTION 'SO_DOCUMENT_REPOSITORY_MANAGER'
      EXPORTING
        method       = wa_method1
        office_user  = wa_owner
        ref_document = wa_ref_document
        new_parent   = wa_new_parent
      IMPORTING
        authority    = wa_authority
      TABLES
        objcont      = tb_objcnt
        objhead      = tb_objhead
        objpara      = tb_objpara
        objparb      = tb_objparb
        recipients   = tb_receipients
        attachments  = tb_attachments
        references   = tb_references
        files        = tb_files
      CHANGING
        document     = wa_document
        header_data  = wa_header.
    endform.                    " send_mail
    By the why, tb_receipients-recnam = 'BAITZ'. What's the meaning of 'BAITZ'? Thanks!

    you can use FM SO_NEW_DOCUMENT_SEND_API1
    WA_RECV TYPE SOMLRECI1,
    IT_RECV TYPE STANDARD TABLE OF SOMLRECI1.
    wa_recv-receiver = 'TO email address'.
    wa_recv-rec_type = 'U'.
    wa_recv-com_type = 'INT'.
    APPEND wa_recv TO it_recv.
    CLEAR wa_recv."To Recipient
    wa_recv-receiver = 'CC email address'.
    wa_recv-rec_type = 'U'.
    wa_recv-com_type = 'INT'.
    wa_recv-copy = 'X'.
    APPEND wa_recv TO it_recv.
    CLEAR wa_recv. "CC Recipient
    wa_recv-receiver = 'BCC email address'.
    wa_recv-rec_type = 'U'.
    wa_recv-com_type = 'INT'.
    wa_recv-blind_copy = 'X'.
    APPEND wa_recv TO it_recv.
    CLEAR wa_recv. "BCC Recipient

  • How to use the eventing and databag with a WAS 6.20 ?

    How to use the eventing and databag with a WAS 6.20 ?
    Is what there is a good guide for these services?
    Thank's

    In the raise event you can pass the value
    like below.
    <SCRIPT>
    function raiseEvt(value1){
    if(window.document.domain == window.location.hostname){
    if ( document.domain.indexOf(".") > 0 ) document.domain = document.domain.substr(document.domain.indexOf(".")+1);
       EPCMPROXY.raiseEvent( "urn:com.sap:BWEvents","BWiViewevent", value1, null );
      // alert('tree domain'+document.domain);
    </SCRIPT>
    and in the
    subscribe event you can get the values like below.
    <script language="javascript">
    if(window.document.domain == window.location.hostname){
    document.domain = document.domain.substring(document.domain.indexOf('.')+1);
        EPCMPROXY.subscribeEvent("urn:com.sap:BWEvents","BWiViewevent", window, "myreceiveEvent");
    function myreceiveEvent( eventObj ) {
          document.forms[0].gp_hidden.value = eventObj.dataObject;
    </script>
    Also look at the following link for a complete documentation.
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/documents/a1-8-4/Enterprise%20Portal%20Client.pdf
    Regards
    Raja

  • How to use warn about changes property with page menus

    how to use warn about changes property with page menus

    Hi,
    If u will enable this property, then u will get warning message as a popup in case of change of state of VO.
    Regards,,
    Gyan

  • ANyone know how to use an Apple keyboard A1359 with a MacBook Air?

    Does anyone know how to use an Apple Keyboard A1359 with a MacBook Air?

    I'm going to ask the hosts to move this to the macbook forum since you're more likely to get answers there than in the iPad one.

  • HT4623 How to use epson iprint after connected with iPad help

    How to use epson iprint after connected with iPad help.

    When you open Epson iPrint, you will see the various options of ways to proceed, e.g., Photos (to print photos), Maintenance (for printer maintenance). Scan (to perform scanning).

  • How to use Time Capsule via INTERNET WITH WINDOWS 7 SMB Cloud

    how to use Time Capsule via INTERNET WITH WINDOWS 7 SMB Cloud

    Get a vpn router.. I have no idea where you are in the world but you can find reasonable stuff for not too much money or even a general router that takes third party firmware like dd-wrt can run openvpn. 
    Set up the vpn router in place of the TC, as the main router in the network. Simply bridge the TC and place it behind the router. It will be accessible as part of the network via the vpn.
    This is the only safe way to do it via windows.
    http://www.dyncommunity.com/questions/18132/accessing-time-capsule-from-windows- 7-over-the-int.html
    If you google around I have seen posts about how to access TC by port forwarding SMB on the TC.. using a different port.. To me this is going to slow down the hackers by a day or two.. then they will discover the open port and access your network.. not just the TC.. they now have SMB access to everything. Don't do it. There is very little security on SMB.

  • Does anyone kwow how to use the Korg M50 editor with garageband?

    does anyone kwow how to use the Korg M50 editor with garageband?

    Moved from the Creative Cloud to the Photoshop forum. They will be able to help you here.

  • Can not redirect to other page when using adfc-config.xml in standalone WL

    Hi all,
    I created a very simple fusion app, only have two jspx pages(view1 view2). I drag these two pages to adfc-config file and created a control flow(adfcView2) between these two pages.
    +<?xml version="1.0" encoding="UTF-8" ?>+
    +<adfc-config xmlns="http://xmlns.oracle.com/adf/controller" version="1.2">+
    +<view id="view1">+
    +<page>/view1.jspx</page>+
    +</view>+
    +<view id="view2">+
    +<page>/view2.jspx</page>+
    +</view>+
    +<control-flow-rule>+
    +<from-activity-id>view1</from-activity-id>+
    +<control-flow-case>+
    +<from-outcome>adfcView2</from-outcome>+
    +<to-activity-id>view2</to-activity-id>+
    +</control-flow-case>+
    +</control-flow-rule>+
    +</adfc-config>+
    When I run the view1.jspx in the embeded WL, all go well, can navigate from view1 to view2.
    But when I created an ear and deployed this ear to a standalone WL, view1 can be displayed successfully, but when I clicked one commandbutton in view1, want to navigator to view2, the page can not be redirected to view2(still show view1.jspx). there is no any error msg in WL Console.
    Did I miss anything for deploying a taskflow app? If I change the view controller to faces-config.xml not adfc-config.xml, all work fine.
    Any info is appreciated.
    Edited by: harth on Oct 25, 2009 7:21 PM

    Hi Harth,
    I guess you are running the jspx page not view activity, check if your url contains .jspx page at the end. If so, run the url without .jspx page at end(which is view id name)
    Eg:
    Give http://<Host_Name>:<Port>/<ContextRoot>/faces/view1 instead of http://<Host_Name>:<Port>/<ContextRoot>/faces/view1.jspxSireesha
    Edited by: Sireesha Pinninti on Oct 25, 2009 8:00 PM

  • JClient/ADF How to use JCLoginDialog to change user

    Hi,
    can anyone give me a clue how to use JCLoginDialog that is automatically generated during design time ?
    I`d like also to add there database name and sid to change also database not only user during run-time.
    thx in advance,
    Jacek

    i,
    JCLogin Dialog is a JAAS based authentication dialog that doesn't perform database authentication or connection. We are workin on a whitepaper explaining what needs to be done to write a database login screen instead
    Frank

Maybe you are looking for

  • Why are emails I deleted from another computer still showing up in my iPad inboxes.

    This is just plain annoying. Every time I pick up my iPad, I have to delete dozens of emails I already deleted from my mailboxes (I have multiple accounts ... yahoo gmail hotmail etc.) I looked for a setting that would fix this, but nothing I'm findi

  • System in the cluster not responding

              Hi,           We are runing a weblogic cluster with a shared hard disk , with two weblogic instances           on 120.120.120.120 and 120.120.120.121 , this is the stacktrace of the former           instance .           By this I feel that

  • How do you auto generate series of dates or numbers in iPad Numbers?

    Hi, I am using Numbers app on the latest iPad Air 2 running iOS 8. On the OS X version of Numbers, you could type the first two numbers in two rows and drag them while they are both selected to generate the rest of the numbers or dates or formulas ac

  • Glossy or Matte? about to make the leap, need advice ...

    I am about to finally make my much anticipated leap into the world of well, you know ... The plan is to order a 17" MBP, 2.6GHz, 200GB 7200, enhanced rez, mostly for photoshop CS3 and graphics design, and the question is: glossy or matte? All timely

  • Where can I find multimedia files tags when browsing under Finder?

    Hello everyone. I'm a newbie in the Macworld so I'm visiting these forums looking for help. I created several mpeg2-videofiles on Windows XP SP2, Then I added some tags via file explorer (in the contextual menu, properties then summary). When I copie