JSF action executed twice

Hello all,
sorry for my bad english.
I've a simple form with only one <h:commandButton> who execute an action method.
In this method i need to do a sleep of 60 seconds.
The strange thing is that while waiting the 60 seconds, the action method is executed twice !
This is my code:
SimplePage.jsp
<h:form id="simple_form">
  <h:commandButton id="ok_button" value="OK" action="#{bBean.doAction}" />
</h:form>BackingBean.java
  public String doAction()
    try
      Thread.sleep(60000);
    catch (InterruptedException e)
      e.printStackTrace();
    return "ok";
   }Any help is appreciate.
Carlo

Hi Raymond,
thanks for the reply.
As you suggested , I've created a JSP page with only one form and submit button that fires an action who sleep for 60 seconds.
In this case action is invoked only once.
Any suggestion ?
Thanks in advance
Carlo

Similar Messages

  • Struts Action Executing Twice - due to request.forward???

    The code below is causing Firefox to execute the action class twice. But it does not happen in IE or Opera. Anyone???
    request.getRequestDispatcher(newPath).forward(request, response);
    Is this expected behavior with forwarding a request and IE and Opera is just ignoring it? If I do a response.redirect() then it exits the servlet correctly. I'd love some kind of explanation, cause I'm at a loss.
    Thanks,
    Brian Beech

    But the action class is executed in your server, isn't it? And Firefox has no way of knowing that your code has forwarded to a different URL, browsers don't get notified of that sort of thing.
    I'm not saying that your server doesn't work differently if Firefox sent the request versus if IE sent the request. I'm assuming that's a correct description of the problem. I'm just saying that to find out what's happening you need to understand how things work, in particular what happens in the client and what happens in the server. Your problem appears to be in the server and not in the client.

  • Action executing twice while loading tiles

    hi
    I am arun
    I am using tiles-def.xml to load my layout
    actuaaly merequest going in following way
    jsp-->action--->actionforward-->sucess(layoutpage)
    jsp is executing only once
    but when the requet reaches action
    action is executing twice
    can anyone help me onthis

    Hi Udaykumar,
    Where did u removed the symbol (#).. In ur JSP (or) in tiles-def.xml (or) in action..?
    regards,
    Satheesh.J

  • ActionPerformed-method executed twice...

    Please help!
    My program behaves strangely; the actionPerformed method on a button is executed twice. The first execution completes the method as it should and makes changes to the model as it should. Then there comes the second execution triggered BY THE SAME BUTTON AT THE SAME TIME as the first execution. How is this possible? And how to fix things? There are no external triggers to the button.
    Here is the example code showing the method actionPerformed and the output that it prints.
    * Method to run when an answer is selected
    public void actionPerformed(ActionEvent arg0) {
    // Printout info on the action
    System.out.println("EKO actionPerformed-method at beginning. Game level " + mymodel.getLevel());
    System.out.println("EKO action command: " + arg0.getActionCommand());
    System.out.println("EKO action was: " + arg0.ACTION_PERFORMED);
    System.out.println("EKO action time: " + arg0.getWhen());
    // Disable buttons
    enableButtons(false);
    // Call method setVastattu to notify the observers that an answer
    // has already been selected (e.g. probressBar needs to be stopped)
    mymodel.setAnswered();
    if (arg0.getActionCommand()==mymodel.getKysymys()[1])
    System.out.println("EKO answer was correct. Game level " + mymodel.getLevel());
    // Call a method to set new choice texts on the buttons and to set the game level one higher
    mymodel.levelUp();
    System.out.println("EKO after levelUp-method. Game level " + mymodel.getLevel());
    else {
    JOptionPane.showMessageDialog(this, "Wrong answer!");
    mymodel.setWrongAnswer();
    EKO actionPerformed-method at beginning. Game level 1
    EKO action command: Kuurupiilo
    EKO action was: 1001
    EKO action time: 1133534802433
    EKO answer was correct. Game level 1
    EKO levelUp method is setting game level to level 2
    EKO after levelUp-method. Game level 2
    EKO actionPerformed-method at beginning. Game level 2
    EKO action command: Punahilkka
    EKO action was: 1001
    EKO action time: 1133534805567
    EKO answer was correct. Game level 2
    EKO levelUp method is setting game level to level 3
    EKO after levelUp-method. Game level 3
    EKO actionPerformed-method at beginning. Game level 3 <= WHY AGAIN???
    EKO action command: Punahilkka <= SAME ACTION HAS ALREADY BEEN HANDLED
    EKO action was: 1001 <= SAME ACTION HAS ALREADY BEEN HANDLED
    EKO action time: 1133534805567 <= EVEN THE ACTION TIME IS THE SAME...

    WOW!
    Exactly! I indeed had the actionlistener added twice. I did not even know that it is possible to have several overlapping actionlisteners! Now my code works fine. Thank you very, very much!
    Elisa

  • JSP executing twice

    I am calling one JSP from another, via a Javascript function, as I am using the onclick event of an image button. I am using the following code in the calling JSP:
    <INPUT onclick="nextcitation(this.document)" accesskey="N" type="IMAGE" src="images/nextCitation1.gif">
    and the javascript function is as follows:
    function nextcitation(d)
    d.myform.action = "nccaNextCitation.jsp"
    d.myform.submit();
    return false;
    The called jsp, "nccaNextCitation.jsp" sometimes executes once, like it should, and other times it executes twice, using a second newly spawned thread. This causes a real problem, as I am using this JSP to call a servlet which feeds keystrokes in a screen scraping application to a legacy mainframe app.
    It's the inconsistency part to this that's driving me crazy. If it always happened on the first time the button was clicked or the 2nd time, it would be much easier to debug. As it is, it some time happens right away, and other times will be ok until the 5th or 6th time.
    I've searched the forums and google, and have found a few references where this happens, but none of the suggestions (mainly adding "return false") have worked.
    Is there some browser setting or something in the response header I should be looking for?
    I'm using IE 6.0 and WSAD 4.0.3 as my development tool/server.
    Thanks!

    An image input control is really a submit control. Double-submission can happen if you have an onClick handler on a submit button and have that method also do a form.submit(). You can recreate this problem using the following code (irrelevant sections are left out):
    function submitTheForm() {
        document.form.submit();
    <form>
    <input type="submit" name="submitthisform" value="Click Me" onClick="submitTheForm()">
    </form>In the above case, the form itself is submitted in response to the submit button being clicked, but also in response to the form.submit() call.
    Instead of using an image control, why not just use an HREF around an image instead? For example:
    <img src="images/nextCitation1.gif" border="0">
    Michael

  • Coldfusion pages executed twice

    Hi,
    I've a simple application that need login/pass
    authentification,
    I use ce CFLOGIN process to make it work,
    So I login/pass to the application, all is all right but when
    i browse the pages of my application, i've noticed that each page
    are executed twice !!
    Is there a way to solve this issue in the admin or is my
    process wrong ?
    Any help would be great
    regards
    Francois

    For this you really need to share the code you use, else it's
    difficult to solve, it might has to do with some cflocation actions
    triggered by authentication code.

  • JSF Pages are not rendering correctly when  loaded using Non JSF actions

    Hi All,
    This problem is irritating me and I am posting the same query for the third time here.
    When I come from non jsf actions such as page submitting using Javascript, clicking anchor link, clicking normal Html submit button and so on my page is not rendering correctlly .
    In other words, My first GET method/Post method works perfectly for the first time when the page is loaded.
    But when we try to access the page for the second time, although logical work is perfect in bean, I am getting same old page.
    How to resolve this issue?
    or
    Is this Bug of Sun's Implementation of JSF Framework.
    Thanks,
    Sudhakar

    Hi Sudhakar,
    There is a discussion about refreshing a page, Take a look at the below thread
    http://swforum.sun.com/jive/thread.jspa?threadID=55660
    Hope this what you are looking for
    MJ

  • JSF Page is not  rendering correctly on NON JSF Action

    Hi All,
    When I go from JSF actions (clicking HtmlCommandButton HtmlActionLink), I am getting the correct page. But when I come from non jsf actions say if I come through by clicking normal anchor tag or javascript action or normal html submit button, I am getting same old rendered page. How can I overcome this problem??
    Thanks
    Sudhakar

    I am getting same old rendered pageIn otherwords, page is not getting refreshed and contains old data

  • After Update Trigger executes twice when single row is uptd thro proc

    We have the below trigger in our db. When a single record is updated using a procedure the trigger is executed twice and it inserts two records in other table.
    But when i issue an update statement using any sql client tool it is executing only once and inserts only one record in other table.
    Can any one please help me to find the reason?
    Trigger:*
    create or replace TRIGGER CX_HEADER_ESCL_T1 AFTER UPDATE OF STATUS ON CX_HEADER
    FOR EACH ROW
    DECLARE
    "b1-CTRIYJ" boolean := FALSE;
    BEGIN
    IF UPDATING('STATUS') AND(:NEW.status = 'SUCCESS') THEN
    "b1-CTRIYJ" := TRUE;
    END IF;
    IF "b1-CTRIYJ" = TRUE THEN
    INSERT
    INTO siebel.s_escl_req(req_id, created, bt_row_id, rule_id, tbl_name, created_by, group_id)
    VALUES('11111111', CURRENT_DATE, :NEW.row_id, '1-CTRIYJ', 'CX_HEADER', :NEW.last_upd_by, '1-2CU3');
    "b1-CTRIYJ" := FALSE;
    END IF;
    END;
    Procedure:
    CREATE OR REPLACE
    PROCEDURE CLOSE_BATCH
    (ChildRecordCount IN NUMBER, HeaderId IN VARCHAR2, CompletionStatus OUT VARCHAR2) AS
    CafeChildCount NUMBER;
    BEGIN
    select count(*) into CafeChildCount from SIEBEL.CX_CHILD where HEADER_ID=HeaderId;
    IF ChildRecordCount = CafeChildCount THEN
    update SIEBEL.CX_HEADER set STATUS ='SUCCESS', MODIFICATION_NUM = MODIFICATION_NUM+1 where HEADER_ID=HeaderId;
    CompletionStatus := 'SUCCESS';
    ELSE
    update SIEBEL.CX_CHILD set STATUS='FAILED' where HEADER_ID=HeaderId;
    update SIEBEL.CX_HEADER set STATUS='FAILED' where HEADER_ID=HeaderId;
    CompletionStatus := 'FAILED';
    END IF;
    commit;
    /*CompletionStatus := 'SUCCESS';*/
    EXCEPTION
    WHEN OTHERS THEN
    CompletionStatus := SQLCODE;
    rollback;
    END;

    Your problem seems not be related to the trigger restart issue I have already mentioned because you are using a AFTER UPDATE trigger and not a BEFORE UPDATE trigger:
    >
    BEFORE Triggers Fired Multiple Times
    If an UPDATE or DELETE statement detects a conflict with a concurrent UPDATE, then Oracle Database performs a transparent ROLLBACK to SAVEPOINT and restarts the update. This can occur many times before the statement completes successfully. Each time the statement is restarted, the BEFORE statement trigger is fired again. The rollback to savepoint does not undo changes to any package variables referenced in the trigger. Your package should include a counter variable to detect this situation.
    >
    If you are sure that you update a single row and that your trigger fires twice and if you can easiily reproduce the issue, I recommend that you contact Oracle Support and create a Service Request for your issue that could be an Oracle bug.

  • WPF Animation execute twice

    Hi All,
    I faced an issue regarding the Animation execute twice, please check the code:
    <Grid>
    <Grid.ColumnDefinitions>
    <ColumnDefinition Width="Auto"/>
    <ColumnDefinition Width="*"/>
    <ColumnDefinition Width="Auto"/>
    </Grid.ColumnDefinitions>
    <ListView x:Name="lstHandled" Grid.Column="0" Visibility="Visible">
    <ListViewItem>Jimmy</ListViewItem>
    <ListViewItem>Jimmy</ListViewItem>
    <ListViewItem>Jimmy</ListViewItem>
    <ListViewItem>Jimmy</ListViewItem>
    <ListViewItem>Jimmy</ListViewItem>
    <ListViewItem>Jimmy</ListViewItem>
    <ListViewItem>Jimmy</ListViewItem>
    <ListViewItem>Jimmy</ListViewItem>
    <ListView.Triggers>
    <EventTrigger RoutedEvent="ListView.MouseEnter">
    <BeginStoryboard>
    <Storyboard>
    <ThicknessAnimation
    Storyboard.TargetName="spAll"
    Storyboard.TargetProperty="(StackPanel.Margin)"
    From="-100,0,0,0" To="0,0,0,0"
    AutoReverse="False"
    Duration="0:0:1"/>
    </Storyboard>
    </BeginStoryboard>
    </EventTrigger>
    </ListView.Triggers>
    </ListView>
    <StackPanel x:Name="spAll" Grid.Column="0" Width="100" Margin="-100,0,0,0" Orientation="Horizontal">
    <ListView x:Name="Handled">
    <ListViewItem>Hello</ListViewItem>
    <ListViewItem>Hello</ListViewItem>
    <ListViewItem>Hello</ListViewItem>
    <ListViewItem>Hello</ListViewItem>
    <ListViewItem>Hello</ListViewItem>
    <ListViewItem>Hello</ListViewItem>
    <ListViewItem>Hello</ListViewItem>
    <ListViewItem>Hello</ListViewItem>
    </ListView>
    <ListView x:Name="UnHandled">
    <ListViewItem>World</ListViewItem>
    <ListViewItem>World</ListViewItem>
    <ListViewItem>World</ListViewItem>
    <ListViewItem>World</ListViewItem>
    <ListViewItem>World</ListViewItem>
    <ListViewItem>World</ListViewItem>
    <ListViewItem>World</ListViewItem>
    <ListViewItem>World</ListViewItem>
    </ListView>
    <StackPanel.Triggers>
    <EventTrigger RoutedEvent="StackPanel.MouseLeave">
    <BeginStoryboard>
    <Storyboard>
    <ThicknessAnimation
    Storyboard.TargetName="spAll"
    Storyboard.TargetProperty="(StackPanel.Margin)"
    From="0,0,0,0" To="-100,0,0,0"
    AutoReverse="False"
    Duration="0:0:1"/>
    </Storyboard>
    </BeginStoryboard>
    </EventTrigger>
    </StackPanel.Triggers>
    </StackPanel>
    </Grid>
    Here is the screenshot:
    When the mouse leave the "spAll" StackPanel. It fired the Mouse Enter event for the ListView. How to avoid this issue? 
    Thanks a lot!
    The future belongs to those who believe in the beauty of their dreams.

    You put your other two listviews in the same column of the grid.
    Since they're defined later, they will be above the first listview... and cause your problem.
    <Grid>
    <Grid.ColumnDefinitions>
    <ColumnDefinition Width="Auto"/>
    <ColumnDefinition Width="*"/>
    <ColumnDefinition Width="Auto"/>
    </Grid.ColumnDefinitions>
    <ListView x:Name="lstHandled" Grid.Column="0" Visibility="Visible">
    <ListViewItem>Jimmy</ListViewItem>
    <ListViewItem>Jimmy</ListViewItem>
    <ListViewItem>Jimmy</ListViewItem>
    <ListViewItem>Jimmy</ListViewItem>
    <ListViewItem>Jimmy</ListViewItem>
    <ListViewItem>Jimmy</ListViewItem>
    <ListViewItem>Jimmy</ListViewItem>
    <ListViewItem>Jimmy</ListViewItem>
    <ListView.Triggers>
    <EventTrigger RoutedEvent="ListView.MouseEnter">
    <BeginStoryboard>
    <Storyboard>
    <DoubleAnimation
    Storyboard.TargetName="spAll"
    Storyboard.TargetProperty="(StackPanel.Width)"
    From="0" To="120"
    AutoReverse="False"
    Duration="0:0:1"/>
    </Storyboard>
    </BeginStoryboard>
    </EventTrigger>
    <EventTrigger RoutedEvent="ListView.MouseLeave">
    <BeginStoryboard>
    <Storyboard>
    <DoubleAnimation
    Storyboard.TargetName="spAll"
    Storyboard.TargetProperty="(StackPanel.Width)"
    From="120" To="0"
    AutoReverse="False"
    Duration="0:0:1"/>
    </Storyboard>
    </BeginStoryboard>
    </EventTrigger>
    </ListView.Triggers>
    </ListView>
    <StackPanel x:Name="spAll" Grid.Column="1" Width="0" Orientation="Horizontal">
    <ListView x:Name="Handled">
    <ListViewItem>Hello</ListViewItem>
    <ListViewItem>Hello</ListViewItem>
    <ListViewItem>Hello</ListViewItem>
    <ListViewItem>Hello</ListViewItem>
    <ListViewItem>Hello</ListViewItem>
    <ListViewItem>Hello</ListViewItem>
    <ListViewItem>Hello</ListViewItem>
    <ListViewItem>Hello</ListViewItem>
    </ListView>
    <ListView x:Name="UnHandled" Grid.Column="2">
    <ListViewItem>World</ListViewItem>
    <ListViewItem>World</ListViewItem>
    <ListViewItem>World</ListViewItem>
    <ListViewItem>World</ListViewItem>
    <ListViewItem>World</ListViewItem>
    <ListViewItem>World</ListViewItem>
    <ListViewItem>World</ListViewItem>
    <ListViewItem>World</ListViewItem>
    </ListView>
    </StackPanel>
    </Grid>
    The above puts your listviews in different columns, although I'm not 100% sure that's what you wanted to happen.
    You would also have to animate the first listview if you want that to disappear.
    There's a potential problem there since as you do that your mouse will leave it.
    I guess you're probably just kind of playing around learning stuff here though.
     PS
    I based this on your first, now deleted, thread.
    Hope that helps.
    Technet articles: Uneventful MVVM;
    All my Technet Articles

  • Why the code in a user exit is executed twice?

    Hi all,
    I've got a development in a user exit EXIT_SAPMP56T_001.
    This user exit allows us to control the travel expenses.
    When you go to the TX: PR05 you can see a list with travels to add expenses. Here you can select one item on the list and press the edit button to add new expenses.
    We want to control this and we use this user exit for that purpose.
    When the user selects a row and presses the edit button, the user exit is triggered. We can check the values of the table and see which row is selected. But this exit is executed twice. The first time the table doesn't have any changes on it, the second time it has marked the selected row.
    Why is this happening? Why is this exit executed twice? And how can I control that the table is properlly updated?
    Thank you.

    Hi,
    I think this user exist in getting triggered both in the PAI and PBO of that screen.
    For avoiding this use the flag.
    If flag is initial then only your code needs to trigger.
    if flag is initial.
    flag = 'X'.
    then your code.
    endif.
    So when it again comes into the PBO it will check the flag and the same code will not be triggered for the second time.
    With Regards,
    Sumodh.P

  • Why is the last script executed twice?

    Here is my problem. I have two files, file1.sql and file2.sql that are called in a third file test.sql. The output from test.sql show that file2.sql was called twice
    --file1.sql
    select 'file1' as str from dual;
    --file2.sql
    select 'file2' as str from dual;
    --test.sql
    @file1.sql
    @file2.sql
    The output shows:
    STR
    file1
    STR
    file2
    STR
    file2
    Why is the last file execute twice. If I change the order of files in test.sql, then file1 is displayed twice

    I found my problem. In test.sql I had '/' in the last line
    --test.sql
    @file1.sql
    @file2.sql
    /

  • When I schedule a Job, the job is executed twice.

    Post Author: sachinddalal
    CA Forum: Data Integration
    Hello,
    I am using Data Integrator Ver 11.0.2.22. I have scheduled the job through Admin Console. When the job is executed it seems that the job is executed twice.
    On the Status tab onDI Administrator, it shows that both the jobs started at same time. The end time of bot the job is different.
    Any one have any idea how this happens?
    Also any way to ensure that the job are not executed twice.
    Thanks,
    Regards
    Sachin Dalal

    Post Author: bhofmans
    CA Forum: Data Integration
    If you get this issue for a scheduled job only, I might be that the schedule is created twice in the OS scheduler. You could check the windows task scheduler (or cron on UNIX) to check for duplicate schedules.
    If you see this issue also for jobs you execute manually (via webadmin or Designer), you can have this kind of problems if the same jobserver is registered multiple times in a repository. You can check the AL_MACHINE_INFO in your repository. It should have one line for each jobserver and one line for each administrator the repo is connected too. I suspect you have some duplicates there (you can just remove them - this table gets populated when adding a repo in the web admin and when adding a repo to a jobserver in the server manager).

  • Revenue recognition has been executed twice

    HI all
    G/L Balance is not correct as below.
    It looks that some of revenue recognition has been executed twice. There are both items that revenue recognition has been executed twice and items that revenue recognition has been executed once within the same sales order.  I have no idea whether there is any pattern exists or not.  This issue needs to be solved by today .
    what could be the reason, can any one help me on this.
    Thanks in advance,
    Raju

    Hi Raju,
    Can u explain us in detail,
    It can be the reason like if the revenue recog is replicating through some nightly job, there r different cases it may ran twice(relication has done twice).
    Best regards
    Bhupathi.

  • Init() method is executing twice

    Hi,
    I have a servlet & implemented the init() method. But, the init() method is executing twice.
    Also, the destroy() method is executing twice.
    Any input guys.
    Thanks

    JAXMServlet most certainly IS an HttpServlet - the javadocs that I see say it extends HttpServlet. It won't be very useful in a SOAP implementation if it's not.
    I thought the SingleThreadModel interface. Why? I thought that was a bad practice that was discouraged. What writable data members does this "test" servlet have that require such careful treatment? If your servlet implements doGet and doPost methods, with only local variables, it'll be thread-safe enough.
    I follow the Sun Java coding standards, even for dash-off classes. "test" should be capitalized. Is there no more descriptive name you can think of?
    I'm not aware of a problem with Tomcat, and I haven't checked the bug list. But I'd put my money on your code being the problem here. Do you call super.init() in your servlet's init() method? Maybe you're seeing the superclass init() being called?
    %

Maybe you are looking for

  • Update to windows 8.1 fails every time with error 0x80004005

    Like many others trying to install the update (windows 8.1  via Windows Store app),  I keep getting the same error code (0x80004005) in the last stages of the update.  I have successfully installed the update on 3 systems without a hitch - 2 desktop

  • Ordered New 8 Core Today ... is it worth it?

    I bought my first Mac in San Diego in 1984. It was the original 128K Mac. I was in the Navy at the time, and I set my beloved machine up in the Harpoon Missle Launch Room, a space no bigger than a walk-in closet, on the USS Elliot (a Spruance Class D

  • Connecting PC to TV

    Envy Phoenix h-9  1350 Windows 8 Pro. Processor- Intel (R), core(TM) i7, [email protected] 64 bit, Ram 12.0GB Hi, I have an HDMI on my pc and also a HDMI connection on my 52 inch TV. I want to connect those two connections so I can watch movies on my

  • Jumping to a specific point in a clip

    How can I jump to a specific point/frame in a clip? Example: I know a clip is exactly 3:40 long. How could I go to 3:37? Thanks.

  • Porting Forms/Reports when migrating Oracle 9i DB from AIX 5.2 to AIX 5.3

    Hi, Looking for advice on how to port Oracle Forms/Reports modules when moving our Oracle 9i database from AIX 5.2 to AIX 5.3 platform. Details are as below: Oracle Forms and Reports v6i (There is no version upgrade in Forms & Reports) Database is Or