Get FacesContext Instance in HTTP servlet, running before filter faces?

Hello!

I have a HTTP servlet faces filter before running in my application (ADF BC 10.1.3.3). I would like to get an instance of my Module from the Application of this servlet to perform some published methods, I have in my App Module. The problem is that when trying to call FacesContext.getCurrentInstance () .getApplication () throws nullPointerException for FacesContext.getCurrentInstance () returns null. I did some research on it and found that it is because my http servlet runs before the Faces servlet and so I can't get a reference to the FacesContext in this way.

I also found this blog: http://www.thoughtsabout.net/blog/archives/000033.html on how to access the context of faces and backup the beans in a servlet filter. I wonder if anyone has any ideas on this is not not a good approach? Is there a better way to do this? Otherwise, it is a good practice, this post can serve as a tip for someone trying to do a similar thing :).

Thank you
Kind regards!

BB

BB,

If you need an application module in a servlet filter, I'm not sure that I have use the FacesContext at all (I guess you are trying to get a reference to an AM by the binding container). Why not just use normal calls (createRootApplicationModule and release) to get it?

If Miss me something, feel free to correct me ;)

John

Tags: Java

Similar Questions

  • How do I get the instance name in the code to filter using different filters

    Hello

    I tried to read the name of the instance in my filter code using the code below

    String instanceName = binder.getEnvironmentValue ("IDC_Name");

    It worked very well for the validateStandard filter, but when using the afterExportBatch filter or afterImportBatch it gives null as a value. Could someone suggest a solution to read this value...


    Thank you...

    afterImportBatch recovered the value without problems for me in gR 10, 3.

    afterExportBatch is not a valid filter; afterArchiveBatchFile is the correct filter, but I got a null so...

    Try to use the afterDoArchivingExport and afterDoArchivingImport filters to see if they serve your purpose. You won't get a null value for the latter.

  • How do I know if a VI is already running before calling Start Asynchronous Call?

    The new node to start the asynchronous call is great for the spawning of several instances of the reentrant vis.  However, I fell a little bit using for screws not reentrant the old practice of using the method "Run a VI" would allow us to check the Execution.State of the VI before calling the method to execute.  This way if the State was running or running at a higher level, we could spend the invoke node and just use a property node to open the front panel.  With the starting node the asynchronous call, it seems that we must use a strictly typed static VI reference, and when we open the reference VI, VI gets booked and his Execution.State = running.  So, how whether it is not only reserved by wire, but actually running before calling Start redundant?

    Moreover, the redundant beginning has an interesting behavior.  Actually, it will cause the targeted VI must be performed again after it stops.  Even if you tap the Abort button on the target VI, it run immediately still and always the same number of times as the starting node the asynchronous call is executed.  There is nothing wrong with that, and I guess the simple answer is to simply go back to the old method of "run a VI.  It's just that ability over these inputs directly to the connector pane is so nice.  Maybe missing me something obvious.  Oh, I am referring to the call and forget mode (0x80).

    Thank you

    Dan

    Maybe missing me something obvious.  Oh, I am referring to the call and forget mode (0x80).

    Yes you have forgotten that he forgets the Run method always seems to be a better choice for this mode

  • Get a black screen BIOS afer and before Windows logon

    So get a black screen after BIOS and before the Windows logon screen. I checked the RAM and one on two RAM sticks that was bad. But I still have the black screen. I tried an external monitor but still a black screen. I tried all the normal things (verification of the restore point disc, e.g. via the command prompt, startup repair, etc.) and no luck. I ran a test to check the hard drive, and it is impossible to find the hard drive. But then I ran AVG anti-virus, the AVG Live (bootable CD) and at the very start gave me this error: 106 error to the power of disk on life: 8768 (365 days + 8 hours) and underneath were basically the same error, just different numbers. But it still allowed me to run a scan and he was going through the files ok so she did not see the hard drive and files (contrary to the test of hard drive and yes the hard drive test was a bootable cd of same manf. like the hard drive), he found no virus. Even when I ran Defender in offline mode. Then I tried to re - install the operating system on the same drive with a cd. When he was going through the first part of the establishment where it was drivers and so forth: I kept getting the BSOD. Then I took the drive from the laptop and install it in another laptop but she has done the same thing, black screen, so I thought it was the hard drive. But then I begin another hard drive from the laptop and put it in the laptop original and he gave me the black screen and I know that the hard drive was good, she was an operating system that starts when I put it in the not troubled laptop. So any ideas anyone? Would it be possible that the all three things at once: RAM and hard drive laptop motherboard? Any help would be appreciated. Yet once, bios starts, just to Gets a black screen and does nothing after the bios but before the windows logon. The operating system is Vista and it is a Dell laptop, Studio. Any ideas?

    Thank you

    Don

    Hello

    Thanks for posting your question in the community of Microsoft Windows. I understand that you do not get black screen.
    I imagine the inconvenience that you are experiencing. I will definitely help you with this.
     
    To help you suggest several steps to solve the problem, I would appreciate it if you could answer the following questions:
     
    . Did you of recent changes made to your computer?
     
    Please follow the methods and mark the question below:
     
    Method 1:
     
    Follow the steps in the link below.
     
     
    Note: When you restore the system to a previous state, programs and updates installed later will be deleted.
    Important: Running chkdsk on the drive if bad sectors are found on the disk hard when chkdsk attempts to repair this area if all available on which data may be lost
    Note: When you restore the system to a previous state, programs and updates installed later will be deleted.
    Warning: Before installation, you must be prepared for the worst scenarios that led to your existing data on your computer being removed. These data include data personal, settings, information about the hardware and software drivers. In case of a worst case scenario, you may have to reinstall all the programs. Make sure that you back up personal data to disks or other storage devices before performing a clean install.

    Method 2:
     
    How to fix a blue screen stop errors that cause Windows Vista to shut down or restart unexpectedly:
    http://support.Microsoft.com/kb/958233
     
    Note: When you restore the system to a previous state, programs and updates installed later will be deleted.
     

    Warning: Before installation, you must be prepared for the worst scenarios that led to your existing data on your computer being removed. These data include data personal, settings, information about the hardware and software drivers. In case of a worst case scenario, you may have to reinstall all the programs. Make sure that you back up personal data to disks or other storage devices before performing a clean install.
     
     
    Your response is very important for us to ensure a proper resolution. Please get back to us with the information above to help you accordingly.
  • My PC says that I am a working group - that is editable? I'm getting a WiFi a neighbor now but before I had my own cricket modem. ?

    My PC says that I am a group of work-is that will have to be changed since I get a WiFi a neighbor recently? (before I had my own cricket modem.) I need to change the security settings?  How can I tell what programs to allow through my windows firewall and check or not, public or private? So much confusion the more I learn.  I have Wind 7 Home Premium. INternet Ex9... says also uTorrent asked me to update version I was running 73.12 known issues that can cause problems with uTorrent.  Another pop up to wind firewall has blocked some features of uTorrent on every public and private ntwrks and demand allow uTorrent communicate on these networks. (give 2 choices a.Private or private b... not recommended) no one knows what uTorrent is used for? I really appreciate the comments and thanks to all.

    Hello

    I suggest you to uninstall and reinstall Utorrent and check.

    Uninstall or change a program

    http://Windows.Microsoft.com/en-us/Windows7/uninstall-or-change-a-program

    I suggest you perform the clean boot and check.

    Place the computer in a clean boot state, then check if it helps. You can start Windows by using a minimal set of drivers and startup programs. This type of boot is known as a "clean boot". A clean boot helps eliminate software conflicts.

    How to troubleshoot a problem by performing a clean boot in Windows Vista or in Windows 7

    http://support.Microsoft.com/kb/929135

    Note: After troubleshooting, make sure the computer to start as usual as mentioned in step 7 in the above article.

  • How to get BPEL Instance Id #?

    How to get BPEL Instance Id #? so I can pass this value to the database to get an idea on what id what data processed.

    Hi Guibert,

    Create a schema in your process with content below:



    xmlns:p = "http://schemas.oracle.com/service/bpel/common".
    xmlns = "http://schemas.oracle.com/service/bpel/common."
    targetNamespace = "http://schemas.oracle.com/service/bpel/common."
    elementFormDefault = "qualified" >













    Now create a type parameters (i.e. ParamsVar) element (root element in above XSD) in your BPELprocess.
    Now using expression in the copy of the assign activity to assign some value (say InstanceID) in the name of the element (IE here in go to article InstanceID and to the name of the section in ParamsVar will come)
    Now the expression in the copy of the assign to assign activity ora: getInstanceId() to the value of the element (IE here in go to article ora: getInstanceId() and in to Value in ParamsVar section will come)

    At this point, your ParamsVar holds the value of your instaceid.

    Now you must edit the def transformation in BPEL (i.e. of section in source view)... as below

    You will get as below once u set source and target variables

    You must add bpws:getVariableData('ParamsVar') to the foregoing section

    Then it will look like below

    Now, changing add the following model section before and after the namespace definitions

    Here InstanceID will contain the value you pass by transformation.

    Now you can use this setting wherever you want in the transformation as below;

  • Mac OSX, it indicates an instance is all ready running. I try to find .parentlock but am unable to find it.

    I deleted firefox and then re-installed, but it says there is an instance that is already running. I looked all over trying to fine .parentlock (causes of this problem that other Web sites) and cannot locate this file. I am running Mac OSX 10.6

    Create a new profile as a test to see if your profile is the source of the problems.

    See "basic troubleshooting: a new profile:

    If this new profile works then you can transfer files from the old profile to the new profile, but make sure not to copy corrupted files.

    See:

  • The Windows Task Manager shows two instances of HpqPhUnl.exe running under XP

    My windows Task Manager shows two instances of HpqPhUnl.exe Runnung.

    * original title - why do I have two HpqPhUnl.exe race? *

    Are you using the quick change of user with more than one user connected and are both instances of HpqPhUnl.exe running under different user names?

    Although it is always possible for malware to masquerade as a legitimate file, HpqPhUnl.exe is related to the HP Photosmart Essential software provided with printers HP all-in-one.

    It seems there were several problems with Photosmart Essential and HP has replaced with HP Photo Creations.  HP claims, however, that he "supports" always Photosmart Essential.  See http://h10025.www1.hp.com/ewfrf/wc/document?docname=c02475046&lc=en&dlc=en&cc=us&product=3857372

    If you have any problems and you're just curious, I suggest you leave the pretty well after scanning with the following just in case two free tools:

    MalwareBytes Anti-Malware
    SUPERAntiSpyware

    If you experience problems with your HP software - and the scans do not present any malware - I suggest to ask in the forums HP (there are 3: consumer, Business and IT resources.)

  • Can we get a video clip for WINDOW 10 before August 29?

    Can we get a video clip for WINDOW 10 before August 29?

    What do you mean by video clip?  There are millions of clips of all the latest versions on YouTube, officially of Microsoft and enthusiasts who like to share.

    In addition, if you run the preview edition, you can open the application 'Getting started', and there are videos more functions and features.

  • Try to find a way to get Ion VCR 2 PC to run Windows 7. ??? It works great under Vista.

    Try to find a way to get Ion VCR 2 PC to run Windows 7. ??? It works great under Vista.

    See http://www.ionaudio.com/vcr2pc

    If there are no Windows 7 drivers Vista drivers can work.

  • On startup, I get a msg of error DLL RUN as follows: 'there was a problem starting C:\ProgramData\ctfmdctr64.dll. The specified module could not be found. »

    I am running Win 7 Pro.  On startup, I get a msg of error DLL RUN as follows: 'there was a problem starting C:\ProgramData\ctfmdctr64.dll.  The specified module could not be found. »

    The error msg box provides an OK button. After clicking this button, everything seems to work well.

    FYI, I use AVG Virus Protection program. I did a system restore to a date before when I think that this problem started. No luck there.

    I suspect some malicious programs hiding somewhere and part of it may have been removed by AVG, but not all.  Anyone know what program calls for this file? How can I get rid of this problem?   Any suggestions would be welcome.

    Thank you.  f* address email is removed from the privacy *

    Disabled under msconfig.exe startup items are moved to this location in the registry:

    HKEY_LOCAL_MACHINE Tools\MSConfig
    To permanently delete, you can delete the key relevant to this place. Method of the prudent man will like so:
    1. Burn a CD of Windows repair. Everyone who makes his own PC must have a maintenance.
    2. Create a System Restore Point.
    3. Start the computer with the CD in repair and check if the above Restore Point is visible.
    4. Start normally.
    5. Remove the offending registry key.
    Please mark my answer as 'Response' in this thread so that it can be closed.
  • Get the value of the question page before submitting.

    Hello all, I use the Application Express 4.2.5.00.08. I have a question on getting a value for a page element before the page is sent. I have a dynamic action:

    Action: Moving the mouse (on a region/State)

    Real Action: $('a[href*="39"]').each (function (index) {}
    lnk = $(this) .attr ('href');
    $(this) .parent)
    . Parent ('tr')
    .Attr ("href data ', lnk")
    {.mouseover (function ()}
    $(this) .css ("cursor", "pointer");
    Lrowrequired var = $(this) .closest ("tr"),.
    BLOCK = lRow.find("td[headers=BLOCK]").text ();
    $x('P39_BLOCK').value = BLOCK;
    })
    {.mouseleave (function ()}
    $(this) .css ('cursor', 'default');
    })
    });

    I am successfully able to get the value of the line while I'm hovering above the report (and P39_BLOCK is refreshing). But, in this case, the value is not set whenever it changes. My question is, if I need to use this value (say, put an another page element when P39_BLOCK is changed) without submitting the page, how is that possible?

    Kind regards
    MFadel.

    Hi Mohamed,

    That's what bothers! In my first dynamic action, I have real action 'Execute JavaScript Code', which doesn't have a property "Page items to show.". And I need this code to retrieve values from the row of the report.

    On the right, you will have the option 'page elements to present' the dynamic JavaScript actions. Only the PL/SQL. And you do not need to handle things strictly the use of javascript. JavaScript is usually used to manipulate items on the page itself, not the things on the server/session). If you need to present before your PL/SQL block, you can either use AJAX call, or you can create a dynamic action of PL/SQL that runs before your JavaScript. Put this field in the 'submit' page elements and the block of code, just put null;

    Here's a sample in javascript, ajax call. It pushes three elements of the page in the session or in the scope where APEX can access their values. You can return values through AJAX if necessary also:

    $.ajax ({type: 'POST',})

    URL: "wwv_flow.show",

    data: {}

    p_flow_id: $('#pFlowId').val (),.

    p_flow_step_id: page,.

    p_instance: $('#pInstance').val (),.

    "x 01': P39_PAGE_ITEM_1, '.

    "x 02': P39_PAGE_ITEM_2, '.

    "x 03': P39_PAGE_ITEM_3, '.

    p_request: 'APPLICATION_PROCESS = YOUR_PROCESS_NAME'

    },

    success: function (data) {}

    Console.log (Data);

    }

    });

    Then you would have a PL/SQL process called YOUR_PROCESS_NAME that can refer to variables such as

    my_var_1 VARCHAR2 (100 CHAR): = APEX_APPLICATION. G_X01; -Javascript password

    my_var_2 VARCHAR2 (100 CHAR): = APEX_APPLICATION. G_X02; -Javascript password

    my_var_3 VARCHAR2 (4000 TANK): = APEX_APPLICATION. G_X03; -Javascript password

    Can I use in my "PL/SQL procedure? Because in the end, I'm trying to use this value in a PL/SQL procedure:

    To answer your last question, Yes, you can use the P39_BLOCK in your PL/SQL, how you demonstrated above, but you must submit in the 'page' referred to submit box, otherwise it uses the last value that has been submitted.

    What I'm not clear, is do you need really value before executing the PL/SQL or you just want your PL/SQL? If you just try to pass it in PL/SQL and then just use the dynamic action of PL/SQL and pass it by using the "elements of the page to present. '' Remember, if you need a new value to publish on the page, you will need to put these fields in the box "items to display the page.

    If you only need the value of front page because you will use in javascript, somewhere, then reference it with jQuery or js and then use AJAX to continue your treatment.

    A third way, you could do, is to create a dynamic action of PL/SQL that runs before the javascript code that is null; in the body of PL/SQL, but put the P39_BLOCK in the "elements of page to submit" box. Who will just send the page element, and then take action dynamic javascript. But, I don't know why you would do that since you can't have the value submitted for javascript to use.

    Hope that all makes sense.

    Jen

  • How to get the ID of the task running via Vsphere Webservice

    I want to get the ID of the currently running task in vcenter server. Because sometimes we have to cancel this task a few reasons. I know that I can use get task PowerCLI for this.

    Can I get the use of Webservice running task ID? Or any other method, we need to integrate with other systems.

    Yes you can.  Have you tried code?  Programming language you are using?  You can create a TaskFilterSpec and then query tasks using TaskHistoryCollector.latestpage to query tasks if you do not know the MOREF of the task you are looking for.  Here is a reference:

    https://www.VMware.com/support/developer/converter-SDK/conv51_apireference/Vim.TaskHistoryCollector.html

    Josh

  • Why do I get a message saying 'you are running an operating system that InDesign can't. See the system requirements for a complete list of the supported platforms. » ? What does that mean?

    Why do I get a message saying 'you are running an operating system that InDesign can't. See the system requirements for a complete list of the supported platforms. » ? What does that mean?

    This means that your machine does not meet the requirements of system for InDesign.  Check the system requirements for InDesign against those of your machine to see where your machine is delivered in default.

    InDesign - http://helpx.adobe.com/indesign/system-requirements.html

  • Why do I get the message that I am running out of storage on my device when my storage icloud is practically empty?

    Why do I get the message that I am running out of storage on my device when my storage icloud is practically empty?

    It could be that your backup may be the cause.

    See if that helps - manage your iCloud - Apple Support storage space

Maybe you are looking for

  • TC and AE cable network works well, but some settings seem odd

    I was stumped by this for some time.  Despite the fact that everything works well, a setting on my TC seems inconsistent with what would be expected.  Here is a summary of my network: 1 modem of the IAF was WIFI and DHCP active off the COAST, and it

  • Satellite L300 PSLBGE - Win XP - FN does not work

    Hello!I just installed Windows XP (sp3) on a satellite L300 PSLBGE by Toshiba... and the FN key does not work.At the moment I have to activate bluetooth... but FN + F8 does not work. What can I do? I installed Hotkey, save energy and controls (1.0.0.

  • Gmail iPad ios9.2.1

    Since the installation of iOS9.2.1 on my iPad2, Gmail will not open through the blue envelope at the bottom of the screen icon.  I am able to remove this icon to then reinstall. I AM able to access my Gmail account via red & for some time the Google

  • X 1 carbon Touch Fingerprint reader 'can not find the fingerprint sensor device' e7210005

    Hi all I have spent far too long trying to solve this problem by myself and need to reach out to someone who may have solved this problem. I read tons of questions similar online and restarted from dozens of times after trying many different things.

  • Forget the password lock screen sony xperiaz3

    Hai, here. Please help me. I forgot my screen lock password. Please help me what should I do now? Myxperia disabled