Intercept all actionListener methods

Hi every body,
Is there a way to intercept actionListener methods ?
ex:
I have
<h:commandLink actionListener="#{mb.actionListener}" value="link" />
In my faces-config.xml I have :
<application>
<action-listener>ca.test.util.security.SecurityActionListner</action-listener>
</application>
The method mb.actionListener is allways excuted before the SecurityActionListner.processAction method, thus I can't intercept it.
Edited by: Faissal on Jun 20, 2009 1:59 PM

Thank you all for your answers :)
My action listener is declared as bellow :
public String actionToDo(){
  LoggingUtils.logAndReturnMessage("ManagedBean.actionToDo",LoggingUtils.INFO);
public void actionTest(ActionEvent e){
          LoggingUtils.logAndReturnMessage("ManagedBean.actionTest",LoggingUtils.INFO);
     }And the SecurityActionListener :
public class SecurityActionListner implements ActionListener{
      private ActionListener parent;
      public SecurityActionListner(ActionListener parent) {
              this.parent=parent;
     public void processAction(ActionEvent event) throws AbortProcessingException {
          // I would like to filter the access to the action listeners or value change events here
          LoggingUtils.logAndReturnMessage("SecurityActionListner.SecurityActionListner",LoggingUtils.INFO);
          parent.processAction(event);
}But the problem here is that actionToMe(ActionEvent e) is allways executed before SecurityActionListner.processAction(ActionEvent event) . The web server console shows me the following text :
Whene I execut ManagedBean.actionTest I have :
INFO : ManagedBean.actionTest
INFO : SecurityActionListner.SecurityActionListnerAs you can see it's impossible to intercept and for exemple deny access to ManagedBean.actionTest because it's executed befor the action listener/
And whene I execute ManagedBean.actionToDo I have :
INFO : SecurityActionListner.SecurityActionListner
INFO : ManagedBean.actionToDoThanks
Edited by: Faissal on Jun 25, 2009 4:10 AM

Similar Messages

  • To intercept all exception of GUI Swing?

    Blank I tried a method in order to intercept all the exception that can be verified to the inside of a GUI Swing without necessarily to mapping all the code of blocks try & catch.
    I was just trying an interface of the class java.lang.Exception in order to try to make a override of the methods, if there is someone that has already experienced this technique.
    THANKS

    bah, you can throw every exception to the caller method,
    and that one can forward it, too
    I have never tried this, but maybe you can forward all exceptions to
    the main() method, and there should be enough only one try-catch block.
    but then you have declare most of your methods to throw something.
    I advise you to handle errors at least in a very primitive manner,
    only using System.err if you do not want to create some user-friendly,
    GUI-based error treatment.
    println is very good for debugging and development, use it, really.
    First, you can ignore all the exceptions in your code,
    and if something goes wrong, just read your console output
    for more debug info.

  • How to get all the methods present in an interface

    hi
    i joined as a new member in sdn.
    i just want to know how to display all the methods present in an interface

    Java Reflection is the answer. Read a tutorial like this or this ...

  • Commandbutton inside popup does not fire action/actionlistener methods

    Hi,
    I am using 11.1.1.4.0
    I have a page and on click of a button on that page, I launch a popup (using showpopupbehaviour, triggertype="click") which has a region (taskflow) inside it. The region is within a af:panelWindow inside the popup. I have also added 2 commandbuttons in the popup. Everything works fine, but the when the popup is visible, and I click the 2 command buttons on the popup, it does not execute the action method (or actionListener) method that I defined for those buttons. Any idea why this must be happening?
    Code for the popup:
    <af:popup id="popup1" contentDelivery="lazyUncached" binding="#{BackingBean.popup}">
    <af:panelWindow modal="true"
    title="#{pageFlowScope.tabContext.outcomeForPopup}"
    id="paWin12"
    helpTopicId="TOPICID_ALL"
    resize="on">
    <af:panelTabbed id="pt123" position="above"
    inlineStyle="width:650px; height:650.0px;">
    <af:showDetailItem id="sdi0"
    text="#{pageFlowScope.tabContext.outcomeForPopup}"
    stretchChildren="first"
    accessKey="0"
    immediate="true">
    <af:region value="#{bindings.r0.regionModel}"
    id="r1"/>
    </af:showDetailItem>
    </af:panelTabbed>
    <af:commandButton text="First"
    action="#{BackingBean.firstClick}"
    actionListener="#{BackingBean.firstClick}"
    id="cb3">
    </af:commandButton>
    <af:commandButton text="Second"
    action="#{BackingBean.secondClick}"
    actionListener="#{BackingBean.secondClick}"
    id="cb4">
    </af:commandButton>
    </af:panelWindow>
    </af:popup>
    In the page definition of the main screen, I have this taskflow added
    <taskFlow id="r0" Refresh="ifNeeded" activation="deferred"
    xmlns="http://xmlns.oracle.com/adf/controller/binding"
    taskFlowId="#{pageFlowScope.tabContext.taskFlowIdForPopup}">
    <parameters>
    <parameter id="outcome"
    value="#{pageFlowScope.tabContext.outcomeForPopup}"
    xmlns="http://xmlns.oracle.com/adfm/uimodel"/>
    <parameter id="tabContext" value="#{pageFlowScope.tabContext}"
    xmlns="http://xmlns.oracle.com/adfm/uimodel"/>
    </parameters>
    </taskFlow>
    Thanks
    Vishal

    Hi friend ,
    1,Inside the pop up u give two command buttons and double click the one button and it asking for create one bean.
    2.U create the bean and inside u give coding like
    public class popvisible
    public popvisible()
    public String page1naviagetion()
    // Add event code here...
    return "popTouser";(This is is Control flow case name it will go to another JSPX page.)
    public String page2navigation()
    // Add event code here...
    return null;
    }

  • How to intercept all events sent to subcomponents of a JFrame

    Hello.
    The title says everything, i think.
    I need to make a gui where there would be a user validity timeout if no action is done during a certain period. (then, a modal dialog would show up, asking for a login/pass).
    I could do that by modifying each and every swing components to have some date of last use" data, and a thread in the window, bla bla bla... but this is too heavy and crappy to me.
    What i would like to do is intercept all events, note the date, and send them normally to who they were sent to originally.
    Has anyone an idea?

    okay, i've succeeded...
    here is the source, in case some ever encounter the problem:
    public class TimeoutGlassPane extends javax.swing.JComponent
         java.awt.Component     here=this;
         /** Creates a new instance of TimeoutGlassPane */
         public TimeoutGlassPane()
              addMouseListener(new javax.swing.event.MouseInputAdapter()
                   public void mouseClicked(java.awt.event.MouseEvent e)
                        dispatch(e);
                   public void mousePressed(java.awt.event.MouseEvent e)
                        dispatch(e);
                   public void mouseReleased(java.awt.event.MouseEvent e)
                        dispatch(e);
                   void dispatch(java.awt.event.MouseEvent e)
                        java.awt.Component component = javax.swing.SwingUtilities.getDeepestComponentAt(((javax.swing.JRootPane)getParent()).getLayeredPane(),e.getX(), e.getY());
                        java.awt.event.MouseEvent mouseEvent=javax.swing.SwingUtilities.convertMouseEvent((java.awt.Component)(e.getSource()), e, component);
                        component.dispatchEvent(mouseEvent);
         protected void paintComponent(java.awt.Graphics g)

  • Hello sir i purchase second hand iphone4s now my iphone ask for activation with id and password i contact with previous owner and use that id and password but that also not work what i do ola help me i try all other method restore ' upgrade

    hello sir i purchase second hand iphone4s now my iphone ask for activation with id and password i contact with previous owner and use that id and password but that also not work what i do ola help me i try all other method restore ' upgrade etc but none work plz say what i do if u find some solution tham msg me on
    iPhone 4S

    oenkz33 wrote:
    this does not help at all for the second owner, after making the first owner id with careless, sorry for my english ...
    Careless? Possible, but unlikely. Most likely the phone was stolen from the first owner. It would be a VERY careless iPhone owner who did not erase their personal information from a phone before selling it, and to do that it is necessary to disable Activation Lock. In most places in the world knowingly using stolen property is a crime, so the fact that the phone doesn't work may be the least of one's risks.

  • Double execution of actionListener method, normal behavior

    Hi,
    I don't understand this behavior i have a commandButton in my JSP
    <h:commandButton value="testActionListener" actionListener="#{LoginBean.actionListener}" immediate="true" />When I click on this button, the associated code (my actionListener method in my bean) is executed two times.
    In my opinion if the scope of my bean is "request" the execution would have to be the constructor then my method actionListener.
    Why do this method is executed two times after the constructor ? Is it the normal behavior ?
    Thanks
    Edited by: Antony97 on Dec 13, 2008 8:03 AM

    hello
    try this link
    http://www.javabeat.net/tips/67-how-to-implement-actionlistener-factionlist.html
    initally i got the same problem
    write seperate bean and actionlistener. as the link suggest your problem is solved

  • ALL Attributes/Methods of FIELD and DICTIONARY

    I am looking for a listing of ALL attributes/methods of fields and dictionaries and forms and afc's if possible, above and beyond what is written in the newScale ISF guide.
    Is this comprehensive list avalable?

    Hi Miriam,
    Have you looked at the Active Form Components Guide ?
    I  don't know that we have any other information more comprehensive than this. Is there something in particular you're looking for that we can track down for you?

  • TS3367 Hi, the FaceTime just did not work between my mom and I. It used to work weeks ago, but now it does not work after showing"connecting". I feel frustrated and try all the method I can think of. Still do not work. Hope u can help me. Thanks!

    Hi, the FaceTime just did not work between my mom and I. It used to work weeks ago, but now it does not work after showing"connecting". I feel frustrated and try all the method I can think of. Still do not work. Hope u can help me. Thanks!

    Was it just this one time?  Could be that you, or your mom, were experiencing network problems.  Try again at a later time.

  • Intercepting all http traffic and forwarding to VIP on CSM?

    We would like to intercept all http traffic from clients from all vlans and redirect them to a VIP on the CSM for loadbalancing to 2 proxy servers. Is this possible? I can't seem to find a solution similar to our issue? Please help thanks!

    Thx Giles! Do you mean a policy that uses route-maps with next-hop? So would I point the next-hop address to the CSM client vlan IP? Do you have a support link that covers this in detail? Thx!

  • Global TOp for all the methods

    HI all,
    I am creating a class, And creating 10 methods inside that class.
    i want to use a single TOP program for data declearation which shud applicable in whole class, so that automatically it eccepts all the methods.
    any idea HOW to create that global data declearation for all methods.
    thanks,
    jo

    Hello Jo,
    In OO-Concept the class variables (Instance or Static) are always visible to the methods.
    If you are different classes, and you want to share variables between them, I would recommend you to use a super class or an interface for the sharing functionalities. Of course these concepts are not exactly for sharing variables. But nevertheless it might help you to solve your problem.
    P.S. I just wanted to simplify the context a little. Naimesh Patel deserves the credit, since he has given the right answer
    Greetz
    G.Fendoglu

  • How define a global variable in a class that all the methods will recognize

    hi friends,
    i need to define a global variable in a class that all the methods will recognize it.
    any suggestions?
    thanks,
    dana.

    Dera Dana,
    In se24, create your own "Z" class.
    Open the Attributes tab.
    Insert your variable in the declaration part.
    EQ:
    Attribute     Level                       Visibility   Typing      Associated Type         Description        
    ITAB     Instance Attribute     Public     Type     Structure name     Description
    In the Layout of View page,
    <phtmlb:formLayoutDropDownListBox id                = "Dropdown"
                                              label             = "Drop Down"
                                              table             = "<%= controller->Itab %>"
                                              nameOfKeyColumn   = "CODE"
                                              nameOfValueColumn = "VALUE"
                                              selection         = "<%= controller->feild to be selected %>"
                                               />
    Hope this will be helpful
    Regards,
    Gokul.N

  • Download code of all the methods in a class to desktop

    Hi,
    I want to download code of all the methods in a class to desktop.
    Its like user will enter Class name on selection screen, then program should download the code of all the methods inside that class on to desktop as a text file.
    How to do it.
    Points will be rewarded!!
    Regards

    You can use FM SEO_CLASS_GET_METHOD_INCLUDES
    to determine the names of all methods implemented in this class with the according names of the includes.
    Than you can loop through the table returned by this FM and get the coding of all methods using READ REPORT statement, whereas you must pass the name of the include of the according method, when executing READ REPORT...
    Reward points, in case reply meets your expectation...
    --MIKE

  • Why all the methods in interface should be implemented

    why all the methods in interface should be implemented

    Because you'll break the contract saying "this instance features all methods defined in that interface" otherwise.
    In other words, as long as an interface isn't completely implemented by an instance, it's not validly implemented at all.

  • How to find all the methods in oops

    Hi all,
    is there any way to find all the methods of all class in a single screen j(ust like using t.code se37 we can find all the fm created)
    sathish

    Hi,
    1.Go to the class builder(SE24).
    2.Type the class name[eg..cl_gui_alv_grid]
    3.You will see a tab called methods.Click that.In that,you can view all the methods.Place the cursor in a method and click parameter tab.You can find the parameters for the method.
    Kindly reward points by clicking the star on the left of reply,if it helps.

Maybe you are looking for

  • Runtime error R6034 c:\program files\itunes\itunes.exe.

    On january 25, 2014 I installed new version of itunes 11.1.4 and error occured:  itunes was not installed correctly. Please reintall itunes. Error 7 (windows error) 1114. Runtime Error:  program c:\files\itunes\itunes.exe.  R6034 An application has m

  • How to customize a nacha report in r12

    Hello , How to customize a NACHA report in r12. And to use a logic in custom template . Thanks Raju

  • GRIR question

    Hi Guru, Could you please advise the system entry when we clear the GRIR balances via MR11? I believe, clearing will force the GRIR to balance, but I can't see any entry posted. Is there a debit entry to GRIR account upon clearing? What would be the

  • HT1918 I want to change my credit card but I cant, how can I change it in Itunes?

    I want to change my credit card but I cant, how can I change it in Itunes?

  • IWeb rss to feedburner- can anyone help? $$!!

    I have browsed several sites for days and still can't find specific information that will help me. I REALLY need quick and concise help here, **** I'll throw a few bucks on paypal to anyone who can help me resolve this issue. seriously. It's a common