Filters applied, called twice sometimes ...

Hi,
I have a small problem which give me headhache...
I'm using a filter to make pre (authentification) and post processing (output the webpage using a XSL transformation).
skeleton :
... doFilter ...
//authentification
chain.doFilter()
//transformation and display
When i'm aslink for a webpage (with a visitor account) there is no problem .., the webpage is displayed properly and the filter is called once ! perfect !
but after my authentification (put a variable containing information onto the session with
"sessionMgr.setSessionUser(session, user);") when I call the same webpage as before the webpage is displayed properly (that's a good point) but I saw in the tomcat console that after the end of the filter , the filter is called again with the same request or null sometimes .... GRRRRR
I read John Hunter article about filters and in its clickstream exampl is using this tips :
// Ensure that filter is only applied once per request.
if (request.getAttribute(FILTER_APPLIED) == null) {
request.setAttribute(FILTER_APPLIED, Boolean.TRUE);
HttpSession session = ((HttpServletRequest)request).getSession();
Clickstream stream = (Clickstream)session.getAttribute("clickstream");
stream.addRequest(((HttpServletRequest)request));
at the start of this filter ...
can I have more explanation about this stuff ...
I really don't understand why this happened ... it seems linked to the session management but I have no proof ...
I find out hard to debug and hard to explain so
THANKS A LOT FOR YOUR SUPPORT :)
see ya
Fran�ois (french guy so sorry for the english)

hi there,
well your problem is interesting........
the solution that you have suggested in your problem regarding the use of FILTER_APPLIED, can be used but not as a long term solution.........
well one thing i can tell you that as i was also facing the same problem of filter called twice, let me explain you the basic behaviour of the filter that a filter is called just before processing any request and again before giving response back to the particulare request........
the next thing i can tell you is from your web.xml it is quite clear that you are mapping each request coming from dispatcher (your servlet) to your filter.......that means any request that points to dispatcher will go to the filter first and then to the actual servlet.
one more thing you are loading the servlet on startup........
just try to remove that code and then check..............
because what happens in this case is when you start your application at that time your servlet will be loaded.........check whether the filter is called at that time or not......i think it must be called.......
and when again a request will come the filter will be called..........this could be possible reasons your filter is called two times.........just try to delete the load on startup line from your web.xml for a while and then check..........
regards
Shishir

Similar Messages

  • Servlet Filters getting called twice

    Hi,
    I am debugging my way through a big project and I am noticing when a http requests comes in that some filters are being called twice.
    I checked the web.xml and nothing funny there and I have checked the respective doFilter() implementations and nothing unusual there.
    Any ideas?
    Thanks.

    Many reasons
    1. Filters are chained - the code in doFilter() upto the call to chain.doFilter() is executed before the request reaches the destined endpoint (servlet/jsp).
    Any code after the call to chain.doFilter() is executed after the endpoint (servlet/jsp) processes the request.
    2. When the response is a redirect, it would cause the browser to send a new request transparently to the end user. This new request would also hit the filter as would be expected.
    3. Filters can be used to intercept internal forwards and/or includes by indicating so in the web.xml. So when such an action happens a part of request processing, filters would be invoked.
    cheers,
    ram.

  • DoGet called twice on Tomcat Startup

    Hi,
    I have a problem with my Servlet doGet/doPost method being called twice (sometimes three times) on Tomcat 5 startup with J2SE 1.4 and Java SE 6. This problem happens on both, Firefox and Internet Explorer.
    I only have one Servlet (called ServletFrontController) in my descriptor, since I decided to use the Front Controller Pattern. This Servlet extends from a "base Servlet" which has all the init configurations. My deployment descriptor looks like this (I also have mappings which I haven't included here):
        <servlet>
            <servlet-name>MainServlet</servlet-name>
            <servlet-class>com.myprogram.ServletFrontController</servlet-class>
            <init-param>
                <param-name>config</param-name>
                <param-value>application.properties</param-value>
            </init-param>
        </servlet>My doGet / doPost / doHead methods from the base Servlet just delegate to the ServletFrontController "main" method, like this:
    public final void doGet(HttpServletRequest request, HttpServletResponse response) {
            try {
                process(request, response);
            } catch (Exception e) {
                handleException(e, request, response);
    }Does anyone had this problem and know why this could happen?
    Martin

    All,
    See post: [http://forum.java.sun.com/thread.jspa?threadID=720175|http://forum.java.sun.com/thread.jspa?threadID=720175]
    Might help.
    - JFK

  • Action at 0ms within symbol is allways called twice

    In Edge Animate 2014.1.1:
    I wonder if its normal behavour that an action that i put at 0ms on the timeline of a symbol is called twice ( sometimes even more often, but i don't know why ) when i start the animation.
    see http:www.pixelsymbiose.de/devpix/testing/test.zip for an example.
    just one symbol with two grafics and an alert at 0ms on the timeline of the symbol.

    there is no difference if i choose autoplay true or false. there is no stop() call only an alert() for testing purposes. the stop() should not make any difference here.
    i should mention, that the timeline is "empty" meaning it has a duration of 0.
    i want to call a script that is initalizing some functionallity of the symbol. of course i could capture a second  call or put the call at 0.5s but both seems to me as a workaround for a bug.
    so is it a bug or is it a feature ?

  • Printing function gets called twice..!

    The following is my class that prints a string array which sometimes goes into multiple pages.. The code in which i create the multiple pages is below this class.. the problem is each time i append a new page to the book the print function in the class PaintC is called twice.. so if I write some additional code inside the print function to edit the strings .. it ends up running twice and the formatting i try to do gets messed up.. !! do you guys know why this is happening..? Please help.. ive been trying to find out since a very long time..!!
    The code in which i call this function is also shown below
    CLASS FOR PRINTING
    class PaintC
        implements Printable {
      String ad[];
      public PaintC(String ac[]) {
        System.out.println("Print Class Called 1");
        this.ad = ac;
      public int print(Graphics g, PageFormat pf, int pageIndex) throws
          PrinterException {
        System.out.println("Print Function Called 1");
        Graphics2D g2 = (Graphics2D) g;
        g.setFont(new java.awt.Font("Trebuchet MS", Font.PLAIN, 8));
        int xo = 60;
        int yo = 36;
        for (int y = 0; y < 76; y++) {
          try {
            g2.drawString(ad[y], xo, yo);
            yo += 9;
          catch (Exception r) {
            y = 76;
        return Printable.PAGE_EXISTS;
    CODE FOR CREATING MULTIPLE PAGES USING ABOVE CLASS
    void dotheprint() {
        PrinterJob printerJob = PrinterJob.getPrinterJob();
        PageFormat format = new PageFormat();
        Printable painter1;
        format = printerJob.defaultPage(format);
        Paper paper = format.getPaper();
        paper.setImageableArea(60, 36, 500, 756);
        format.setPaper(paper);
        // try storing in a string array each line
        Book bk = new Book();
        String ab = jTATRRep.getText();
        int i, j, lc = jTATRRep.getLineCount();
        String ac[] = new String[lc + 3];
        String ad[] = new String[78];
        ac = ab.split("\n");
        //System.out.println("Number of Lines = " + lc);
        //setting up pages as string arrays..
        // setting up first page
        //Assuming 76 lines per page
        for (i = 0; i < 76 && i < lc; i++) {
          try {
            ad[i] = ac;
    catch (Exception ex) {
    bk.append(new PaintC(ad), format);
    ad = null;
    // setting up second page if neccessary
    // //System.out.println("Number of Lines /76= "+lc/76);
    int pagec = lc / 76;
    int modul = lc % 76;
    int k;
    if (modul > 0) {
    pagec++;
    // //System.out.println("Number of pages : "+pagec);
    j = 76;
    while (pagec > 1) {
    ad = new String[76];
    k = 0;
    for (i = j; i < (lc - 1) && k < 76; i++) {
    // //System.out.println("ac[i]= "+ac[i]);
    ad[k] = ac[i];
    k++;
    bk.append(new PaintC(ad), format);
    ad = null;
    j += 76;
    pagec--;
    printerJob.setPageable(bk);
    boolean doPrint = printerJob.printDialog();
    if (doPrint) {
    try {
    System.out.println("Print Called 1");
    printerJob.print();
    System.out.println("Print Called 2");
    catch (PrinterException exception) {
    System.err.println("Printing error: " + exception);
    CODE IN WHICH THE PRINT FUNCTION IS CALLED
    void jBPrint_actionPerformed(ActionEvent e) {
        dotheprint();
    class ContactManager_jBPrint_actionAdapter
        implements java.awt.event.ActionListener {
      ContactManager adaptee;
      ContactManager_jBPrint_actionAdapter(ContactManager adaptee) {
        this.adaptee = adaptee;
      public void actionPerformed(ActionEvent e) {
        adaptee.jBPrint_actionPerformed(e);

    You might want to check out the [url http://forum.java.sun.com/thread.jsp?forum=57&thread=500687&tstart=0&trange=15]crosspost in the swing forum before spending your time answering this question.

  • POWL-Feeder-Class is called twice by class CL_POWL_MODEL

    Hi all,
    we are running sap erecruiting and there's an application called "dashboard" that uses the POWL-Technologie.
    Now we noticed, that our feeder class is called twice when one particular "query" is called via dashboard:
    once within method "handle_refresh_async" and twice within method "refresh_current" (methods of class "CL_POWL_MODEL").
    As we don't want to have double runtime, does anyone know why the feeder class is called twice and how to prevent it?
    Thanks in advance
    Regards
    CHRIS

    Hi Kris,
    thanks for your reply.
    I think the forum message you suggested does not apply to me. They talk about a refresh after an action.
    In my case once the dashboard-query is requested by the user the feeder-class is called twice before the result is displayed.
    Regards
    CHRIS

  • Is this a Bug?: FocusListener called twice

    Hey all,
    Im having this problem since realease 1.4.2_04.
    Folks, try this code:
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public class FocusTest {
        public static void main(String[] args) {
            JFrame frame  = new JFrame("Focus test");
            final JTextField field1 = new JTextField("Test1");
            final JTextField field2 = new JTextField("Test2");
            field1.addFocusListener(new FocusAdapter(){
                public void focusGained(FocusEvent e){}
                public void focusLost(FocusEvent e){
                    if( !e.isTemporary() ){
                        System.out.println("ID: " + e.getID());
                        JOptionPane.showMessageDialog(null, "Focus lost in 1");
                        field1.requestFocus();
            frame.getContentPane().add(field1, BorderLayout.WEST);
            frame.getContentPane().add(field2, BorderLayout.CENTER);
            frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
            frame.setBounds(0,0,200,300);
            frame.show();
    } The problem is: when TF1 looses its focus, and is validated, then i force the focus to keep on TF1 by calling TF1.requestFocus(), somehow the event focusLsot is called twice for my TF.
    If i do not requestFocus() it work but I must force the focus on TF1.
    Im going nuts. Does anyonw apear to have this problems?? In old realeses, the same code work perfect. until 1.4.2 beta.
    Tks
    Bruno

    Hello all!
    I found out that somehow JDialog with requestfocus after, fires twice the lostFocus event. I dont know why. I opened a bug report so they can figure it out why is happaning.
    Tks folks!
    Bruno

  • Back button only works about 50% of the time. Have to hit it twice, sometimes three times before it works. Problem is intermittent. Firefox 3.6.10 on Mac OS 10.6.4 (same on both MacBook and iMac machines).

    Back button only works about 50% of the time. Have to hit it twice, sometimes three times before it works. Problem is intermittent. Firefox 3.6.10 on Mac OS 10.6.4 (same on both MacBook and iMac machines).

    You can try http://kb.mozillazine.org/Bookmarks_history_and_toolbar_buttons_not_working_-_Firefox

  • HELP!!! why derived class's function  be called twice?

    I am a newbie to java.
    Recently I encounter a problem.
    I run the below file,the output is:
    output begin
    B.f called !!!!
    A.A called
    B.f called !!!!
    B.B called
    output end-
    My Question is :
    why B's f() be called twice?
    (In C++, A.f() will be called one time!)
    class A
    A()
    f();
    System.out.println("A.A called");
    int f()
    System.out.println("A.f called !!!");
    return 123;
    class B extends A
    B()
    f();          
    System.out.println("B.B called");
    int f()
    System.out.println("B.f called !!!!");
    return 456;
    public class Demo
    public static void main(String args[])
    B bobj = new B();
    -----------------------------------

    Hi,jsalonen:
    In the following code, variable i cann't be initialized properly.
        class A
             int i=0;
            A()
                f();
                System.out.println("A.A called");
                System.out.println("i="+i);
            int f()
                i=11;
                System.out.println("A.f called !!!");
                return 123;
        class B extends A
             int j;
            B()
                f();                  
                System.out.println("B.B called");
                System.out.println("j="+j);
                System.out.println("i="+i);
            int f()
                j=12;
                System.out.println("B.f called !!!!");
                return 456;
        public class Demo
            public static void main(String args[])
                B bobj = new B();
    output begin
    B.f called !!!!
    A.A called
    i=0 // BAD here
    B.f called !!!!
    B.B called
    j=12
    i=0 // BAD here
    output end -
    Although the question can be solved! I am still confused: why Java do this? when A's constructor call f(), B is still incomplete!!
    Java is a good language,but I dislike it on this
    Regards.
    Sunway

  • Method CreateChildren in ApplicationControllBar class called twice after setting dock=true

    Hi during creating of a custom ApplicationControllBar
    component in ActionScript I probably found a (nasty) bug?!
    package net.neijman.julia.jaContainers
    import mx.containers.ApplicationControlBar;
    public class JAApplicationControlBar2 extends
    ApplicationControlBar
    public function JAApplicationControlBar2(): void
    this.dock = true;
    super();
    override protected function createChildren(): void
    trace("CREATECHILDREN EXECUTED");
    When I am using my simple custom component in my application:
    <jaContainer:JAApplicationControlBar2 />
    The trace message trace("CREATECHILDREN EXECUTED"); is
    executed twice (meaning CreateChildren is called twice BUT ONLY
    AFTER SETTING dock = true (see constructor). When setting dock =
    false CreateChildren is executed once. I want to build a framework
    on the standard components (depending heavily on the
    CreateChildren-method).
    In other words, creating dynamic components in the docked
    ApplicationControlBar in the method CreateChildren results in a
    double placement in the DisplayList.
    Has anyone has a clue what's going wrong here? (my
    workarround for now is to start the createChildren method with
    removeAllChildren();)
    Thanks Tom Neijman

    Interesting. I would file it as a bug here:
    http://bugs.adobe.com/jira/secure/Dashboard.jspa
    And then see what happens. If it's not a bug, you'll probably
    get a decent reason why this occurs in the bug notes.
    matt horn
    flex docs

  • Why listener methods are getting called twice ?

    Hi Group,
    I have a doubt, i need to know logic behind it.
    Lets consider, JComboBox,
    For an item state change of JComboBox,
    itemStateChanged method gets called twice.
    Its similar with valueChanged getting called twice
    on List Selection Event.
    Why does it call twice ? Is there any way, I can
    have invocation only once (except flagging mechanism)?
    with regards,
    vikram.

    http://java.sun.com/j2se/1.3/docs/api/java/awt/event/ItemListener.html
    tells the following:
    public void itemStateChanged(ItemEvent e)
    Invoked when an item has been selected or deselected. The code written for this method performs the operations that need to occur when an item is selected (or deselected).
    So the listener is notified for both items: losing and gaining selection.
    If you are only interested in listening to either selection or deselection event you can check which was the cause for the method call by examing the ItemEvent parameter i.e. item_event.getStateChange() == ItemEvent.DESELECTED or ItemEvent.SELECTED and then decide whether you are interested in the event at all.
    I don't know how to stop JComboBox from launching both select and deselected events.

  • WDDOMODIFY is getting called twice.

    Hi,
    I am facing a problem where wddomodify is getting called twice when I am selecting a value from a drop down. While for other drop downs on the same view WDDOMODIFY is not even getting called. I would appreciate, if anyone of you can provide any info regarding the same.
    Thanks,
    Vishesh

    DATA LO_ND_IMPORTING_CREATE TYPE REF TO IF_WD_CONTEXT_NODE.
        DATA LO_EL_IMPORTING_CREATE TYPE REF TO IF_WD_CONTEXT_ELEMENT.
        DATA LS_IMPORTING_CREATE TYPE WD_THIS->ELEMENT_IMPORTING_CREATE.
        DATA LV_DOC_TYPE TYPE WD_THIS->ELEMENT_IMPORTING_CREATE-DOC_TYPE.
      navigate from <CONTEXT> to <IMPORTING_CREATE> via lead selection
        LO_ND_IMPORTING_CREATE = WD_CONTEXT->GET_CHILD_NODE( NAME = WD_THIS->WDCTX_IMPORTING_CREATE ).
      get element via lead selection
        LO_EL_IMPORTING_CREATE = LO_ND_IMPORTING_CREATE->GET_ELEMENT( ).
      get single attribute
        LO_EL_IMPORTING_CREATE->GET_ATTRIBUTE(
          EXPORTING
            NAME =  `DOC_TYPE`
          IMPORTING
            VALUE = LV_DOC_TYPE ).
         DATA LO_ND_IF_EDITABILITY TYPE REF TO IF_WD_CONTEXT_NODE.
         DATA LO_EL_IF_EDITABILITY TYPE REF TO IF_WD_CONTEXT_ELEMENT.
         DATA LV_EDIT_SUB_TYPE     TYPE WD_THIS->ELEMENT_IF_EDITABILITY-EDIT_SUB_TYPE.
         DATA LV_EDIT_PARENT       TYPE WD_THIS->ELEMENT_IF_EDITABILITY-EDIT_PARENT.
         DATA LV_DROPDOWN          TYPE REF TO CL_WD_DROPDOWN_BY_KEY.
         DATA LV_INPUTFIELD        TYPE REF TO CL_WD_INPUT_FIELD .
       navigate from <CONTEXT> to <IF_EDITABILITY> via lead selection
         LO_ND_IF_EDITABILITY = WD_CONTEXT->GET_CHILD_NODE( NAME = WD_THIS->WDCTX_IF_EDITABILITY ).
       get element via lead selection
         LO_EL_IF_EDITABILITY = LO_ND_IF_EDITABILITY->GET_ELEMENT( ).
         LO_EL_IF_EDITABILITY->GET_ATTRIBUTE(  EXPORTING   NAME =  `EDIT_SUB_TYPE`
                                               IMPORTING  VALUE = LV_EDIT_SUB_TYPE ).
         LO_EL_IF_EDITABILITY->GET_ATTRIBUTE(  EXPORTING   NAME =  `EDIT_PARENT`
                                               IMPORTING  VALUE = LV_EDIT_PARENT ).
          DATA LO_ND_FUNCTIONALITY TYPE REF TO IF_WD_CONTEXT_NODE.
          DATA LO_EL_FUNCTIONALITY TYPE REF TO IF_WD_CONTEXT_ELEMENT.
          DATA LS_FUNCTIONALITY TYPE WD_THIS->ELEMENT_FUNCTIONALITY.
          DATA LV_OPTION_CHANGED TYPE WD_THIS->ELEMENT_FUNCTIONALITY-OPTION_CHANGED.
          DATA LV_OPTION_SELECTED TYPE WD_THIS->ELEMENT_FUNCTIONALITY-OPTION_SELECTED.
        navigate from <CONTEXT> to <FUNCTIONALITY> via lead selection
          LO_ND_FUNCTIONALITY = WD_CONTEXT->GET_CHILD_NODE( NAME = WD_THIS->WDCTX_FUNCTIONALITY ).
        get element via lead selection
          LO_EL_FUNCTIONALITY = LO_ND_FUNCTIONALITY->GET_ELEMENT( ).
        get single attribute
          LO_EL_FUNCTIONALITY->GET_ATTRIBUTE(
            EXPORTING
              NAME =  `OPTION_CHANGED`
            IMPORTING
              VALUE = LV_OPTION_CHANGED ).
          LO_EL_FUNCTIONALITY->GET_ATTRIBUTE(
            EXPORTING
              NAME =  `OPTION_SELECTED`
            IMPORTING
              VALUE = LV_OPTION_SELECTED ).
      DATA LO_EL_CONTEXT TYPE REF TO IF_WD_CONTEXT_ELEMENT.
      DATA LS_CONTEXT TYPE WD_THIS->ELEMENT_CONTEXT.
      DATA LV_SET_STATE TYPE WD_THIS->ELEMENT_CONTEXT-SET_STATE.
    get element via lead selection
      LO_EL_CONTEXT = WD_CONTEXT->GET_ELEMENT( ).
    get single attribute
      LO_EL_CONTEXT->GET_ATTRIBUTE(
        EXPORTING
          NAME =  `SET_STATE`
        IMPORTING
          VALUE = LV_SET_STATE ).
      IF LV_SET_STATE = 'X'.
      IF LV_DOC_TYPE = 'ABC' AND LV_EDIT_SUB_TYPE IS INITIAL.
         LO_EL_IF_EDITABILITY->SET_ATTRIBUTE(
              NAME =  `EDIT_SUB_TYPE`
              VALUE = 'X' ).
          LV_DROPDOWN ?= VIEW->GET_ELEMENT('DRPDWN_SUBTYPE_CHANGE').
          CALL METHOD LV_DROPDOWN->SET_STATE
            EXPORTING
              VALUE  = 01
          ELSE.
          LO_EL_IF_EDITABILITY->SET_ATTRIBUTE(
              NAME =  `EDIT_SUB_TYPE`
              VALUE = '' ).
          LV_DROPDOWN ?= VIEW->GET_ELEMENT('DRPDWN_SUBTYPE_CHANGE').
          CALL METHOD LV_DROPDOWN->SET_STATE
            EXPORTING
              VALUE  = 00
        ENDIF.
        IF LV_EDIT_PARENT IS INITIAL AND
                    ( LV_DOC_TYPE = '123' OR LV_DOC_TYPE = 'qwerty').
          LO_EL_IF_EDITABILITY->SET_ATTRIBUTE(
              NAME =  `EDIT_PARENT`
              VALUE = 'X' ).
          LV_DROPDOWN ?= VIEW->GET_ELEMENT('DRPDWN_PARENT_CHNG_DOCTYPE').
          CALL METHOD LV_DROPDOWN->SET_STATE
            EXPORTING
              VALUE  = 01
          LV_INPUTFIELD ?= VIEW->GET_ELEMENT('IF_PARENT_CHNG_DOCNUM').
          CALL METHOD LV_INPUTFIELD->SET_STATE
            EXPORTING
              VALUE  = 01
          ELSE.
          LO_EL_IF_EDITABILITY->SET_ATTRIBUTE(
              NAME =  `EDIT_PARENT`
              VALUE = '' ).
          LV_DROPDOWN ?= VIEW->GET_ELEMENT('DRPDWN_PARENT_CHNG_DOCTYPE').
          CALL METHOD LV_DROPDOWN->SET_STATE
            EXPORTING
              VALUE  = 00
          LV_INPUTFIELD ?= VIEW->GET_ELEMENT('IF_PARENT_CHNG_DOCNUM').
          CALL METHOD LV_INPUTFIELD->SET_STATE
            EXPORTING
              VALUE  = 00
        ENDIF.
         LO_EL_CONTEXT->SET_ATTRIBUTE(     NAME =  `SET_STATE`
                                          VALUE =   ' ' ).
      ENDIF.
      LO_EL_CONTEXT->GET_ATTRIBUTE(
        EXPORTING
          NAME =  `SET_STATE`
        IMPORTING
          VALUE = LV_SET_STATE ).
          IF LV_OPTION_CHANGED = 'X' AND LV_OPTION_SELECTED = 'C'.
              DATA LO_ND_ZGGL TYPE REF TO IF_WD_CONTEXT_NODE.
              DATA LO_EL_ZGGL TYPE REF TO IF_WD_CONTEXT_ELEMENT.
            navigate from <CONTEXT> to <ZGGL_RICEFTOOL> via lead selection
              LO_ND_ZGGL = WD_CONTEXT->GET_CHILD_NODE( NAME = WD_THIS->WDCTX_ZGGL).
              LO_ND_ZGGL->INVALIDATE( ).
            get element via lead selection
              LO_EL_ZGGL = LO_ND_ZGGL->GET_ELEMENT( ).
              LO_ND_IMPORTING_CREATE->INVALIDATE( ).
              LO_EL_IMPORTING_CREATE = LO_ND_IMPORTING_CREATE->GET_ELEMENT( ).
              LO_EL_IMPORTING_CREATE->SET_ATTRIBUTE(      NAME =  `VISIBILITY_GROUP`
                                                         VALUE =   '2' ).
              LO_EL_IMPORTING_CREATE->SET_ATTRIBUTE(      NAME =  `VISIBILITY_TABLE`
                                                         VALUE =   '1' ).
              LO_EL_IMPORTING_CREATE->SET_ATTRIBUTE(
                   NAME =  `ACTION_RDBTN`
                   VALUE = 'C' ).
              LO_EL_IF_EDITABILITY->SET_ATTRIBUTE(
                  NAME =  `EDIT_CREATE`
                  VALUE = ' ' ).
             LO_EL_IF_EDITABILITY->SET_ATTRIBUTE(
                  NAME =  `EDIT_DISPLAY`
                  VALUE = 'X' ).
             LO_EL_FUNCTIONALITY->SET_ATTRIBUTE(    NAME  =  `OPTION_CHANGED`
                                                     VALUE = ' ' ).
            ENDIF.

  • ADF Faces: dialog framework calls  twice prepareModel and prepareRender

    Hi ,
    does anybody know why ADF Faces dialog framework calls twice prepareModel and prepareRender lifecycle methods . That's a really problem for me because i'm calling db procedures through backing beans methods which are attached on components properties.
    I cannot allow myself to cal the procedures more than once.
    Can somebody help me?
    Krasi

    Okay, although the servlet doesn't require to be run inside the JSF context, I added "/faces" to the URL simply because this would allow me to query the "postback" flag. In other words, I changed the invocation URL from "/jrrun" to "/faces/jrrun".
    In the servlet's "service()" method I put:
    logger.debug(">>>>>> isPostBack? " + AdfFacesContext.getCurrentInstance().isPostback());
    I also attached a JSF PhaseListener to the whole thing.
    Then I opened the parent page, I clicked on the button and the dialog appeared. The console output follows:
    07/01/19 21:37:05 ------------- start of phase RESTORE_VIEW 1
    07/01/19 21:37:05 ------------- end of phase RESTORE_VIEW 1
    07/01/19 21:37:05 ------------- start of phase RENDER_RESPONSE 6
    2007-01-19 21:37:05,156 - DEBUG - >>>>>> RunJasperReport: beginning
    2007-01-19 21:37:05,156 - DEBUG - >>>>>> isPostBack? false
    2007-01-19 21:37:05,156 - DEBUG - >>>>>> RunJasperReport: repPath=/reports/newRegByBusType_Report.jasper
    2007-01-19 21:37:07,047 - DEBUG - >>>>>> RunJasperReport: report output (PDF) was generated successfully. Its total size is 59596 bytes.
    2007-01-19 21:37:07,047 - DEBUG - >>>>>> RunJasperReport: done
    07/01/19 21:37:07 ------------- end of phase RENDER_RESPONSE 6
    07/01/19 21:37:09 ------------- start of phase RESTORE_VIEW 1
    07/01/19 21:37:09 ------------- end of phase RESTORE_VIEW 1
    07/01/19 21:37:09 ------------- start of phase RENDER_RESPONSE 6
    2007-01-19 21:37:09,625 - DEBUG - >>>>>> RunJasperReport: beginning
    2007-01-19 21:37:09,625 - DEBUG - >>>>>> isPostBack? false
    2007-01-19 21:37:09,625 - DEBUG - >>>>>> RunJasperReport: repPath=/reports/newRegByBusType_Report.jasper
    2007-01-19 21:37:09,672 - DEBUG - >>>>>> RunJasperReport: report output (PDF) was generated successfully. Its total size is 59596 bytes.
    2007-01-19 21:37:09,688 - DEBUG - >>>>>> RunJasperReport: done
    07/01/19 21:37:09 ------------- end of phase RENDER_RESPONSE 6
    By the way, partialSubmit="true" has the same effect as partialSubmit="false".
    I'm not sure I understand you correctly. Or perhaps you don't understand me correctly.
    I haven't got a problem with the parent page. I have a problem with the dialog page. It's executed twice. The RENDER_RESPONSE phase (as well as the RESTORE_VIEW phase) is executed twice.
    I want it to be executed only once. I don't want the servlet to be executed twice.
    Let me point out again that in the Embedded OC4J (inside JDeveloper) everything is okay. The servlet is executed only once. However, the same thing on OAS 10.1.3.1 runs twice.

  • Why is the ActionForms validate-Method called twice?

    Hello forum,
    I'm new to struts and want to develop a form, where an internetuser can leave a comment to an article. Just like most sides, an image with an text is displayed, the text has to be written into an inputfield before the comment is commited in order to be saved.
    When an user puts in no text or a wrong one, a errormessage is displayed, the old image is deleted and an new one is created and shown to the user. His input still stays in the fields.
    I proof the correctness of the word in the validate-Method of the ActionForm and it works fine.
    Now I've the following problem:
    If the user puts in the correct text, the comment is saved and the side is displayed again including his comment.. But also all the input of the form should be erased. But for some reason, its not and the validate method is called again and since there is a new wordvarifyingimage and a new text to be inserted, it throws an error which is displayed again. Also, all the input of his last message is present!
    So, I guess I miss a big point about the ActionForm handling. Why is the ActionForm called twice and why doesn't it erase the old input? I try to do this in the Action class after saving the comment, setting all the formparameters to "" or null.
    Can anybody give me a hint?
    Would be a big big help since I've not found anything googling about this issue.
    If you need code, just tell me which part I put in here (ActionForm, Action, struts-config or jsp-file)
    Thanxs in advance,
    strutsnewbytopro

    my jsp:
    <%@ taglib uri="/WEB-INF/tld/struts-bean.tld" prefix="bean" %>
    <%@ taglib uri="struts/html-el" prefix="html" %>
    <%@ taglib uri="jstl/c" prefix="c" %>
    <%@ taglib uri="/WEB-INF/tld/struts-logic.tld" prefix="logic" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html>
    <head>
    <style type="text/css" title="currentStyle" media="screen">
              @import "../library/css/blog.css";     
         </style>
    <script language="javascript">
         function sendMail(){
              document.forms[0].formaction.value ='mail';
              document.forms[0].submit();
         function saveComment(){
              document.forms[0].formaction.value ='comment';
              document.forms[0].submit();
         </script>
    </head>
    <body>
    <html:form action="/blog">
    <div id="container">
         <div id="leftside">
              <logic:messagesPresent>
                   <div id="errors">
                        <div style="color:#CC3333; ">
                        <p><span id="errorHeaders"><bean:message key="errors.validation.header"/></span>
                             <html:messages id="error">
                             <c:out value="${error}"/>
                             </html:messages>
                        </p></div>
                     </div>
              </logic:messagesPresent>
                 .... show blogentry ...          
              <logic:present name="comments">
                   <div id="divblogcomment">
                   <logic:iterate name="comments"  id="com">
                   <div class="breaker10" style="clear:left; "></div>
    <div class="rowblogcommentdate" style="width:150px;"<a href="<bean:write name="com" property="website" />"><bean:write name="com" property="username" /></a> am <bean:write name="com" property="postdate" /></div>
                   <div class="rowblogcomment"><bean:write name="com" property="comment" /></div>
                   </logic:iterate>
                   <div class="breaker10" style="clear:left; "></div>
    </div>
              </div>
                             </logic:present>
                             <logic:notPresent name="savedcomment">
                                  <div id="writeblogcomment">
                                  <div class="topbig"><div class="headsmall">enter Comment</div></div>
                                  <div id="bginhaltwriteblogcomment">
                                       <div class="breaker10" style="clear:left; "></div>
                                       <div align="center">
                                            <table cellpadding="0" cellspacing="0" border="0">
                                                 <tr>
                                                      <td>Name:</td>
                                                      <td>  </td>
                                                      <td><html:text size="50" name="blogForm2" styleClass="inputtext" property="username"/></td>
                                                      <td>  </td>
                                                      <td>Web:</td>
                                                      <td>  </td>
                                                      <td><html:text size="50" name="blogForm2" styleClass="inputtext" property="webaddress"/></td>
                                                 </tr>
                                                 <tr>
                                                      <td>Enter Code:</td>
                                                      <td>  </td>
                                                      <td><html:text size="66" name="blogForm2" styleClass="inputtext" property="commentword"/></td>
                                                      <td>  </td>
                                                      <td >Code:</td>
                                                      <td>  </td>
                                                      <td><img src="<bean:write name="entry" property="commentpicurl" />"></td>
                                                 </tr>
                                                  <tr>
                                                      <td colspan="7">Comment<br><html:textarea name="blogForm2" styleClass="comment" property="comment" /></td>
                                                 </tr>
                                                 <tr>
                                                      <td colspan="7"><html:submit styleClass="inputtext" onmousedown="javascript:saveComment();"><bean:message key="button.save"/></html:submit></td>
                                                 </tr>                                        
                                            </table>
                                       </p>
                                       </div>
                                       <div class="bottombig"></div>
                                  </div>
                             </div>
                             </logic:notPresent>
                             <logic:present name="savedcomment">
                             <div id="writeblogcomment">
                                  <div class="topbig">Comment saved<div class="headsmall">Kommentar gespeichert</div></div>
                                  <div id="bginhaltwriteblogcomment">
                                       <div class="breaker10" style="clear:left; "></div>
                                       <div align="center">
                                            <table cellpadding="0" cellspacing="0" border="0">
                                                 <tr>
                                                      <td>Comment saved</td>
                                                 </tr>
                                            </table>
                                       </p>
                                       </div>
                                       <div class="bottombig"></div>
                                  </div>
                             </div>
                             </logic:present>
                             </div>
    </div>
    <html:hidden name="blogForm2" property="formaction"/><br>
    <html:hidden name="blogForm2" property="id"/><br>
    <% session.removeAttribute("savedcomment"); %>
    </html:form>
    </body>
    </html>

  • Why imageComplete is called twice!

    I wrote the following code:
    public class Test{
    public static void main(String[] args){
    //get image
    Image image = Toolkit.getDefaultToolkit().createImage("javalogo.gif");
    ImageConsumerImpl impl = new ImageConsumerImpl();
    //get image producer
    ImageProducer ip = image.getSource();
    // start production
    ip.startProduction (impl);
    //wait here
    class ImageConsumerImpl implements ImageConsumer{
    // other methods are "null"
    public void imageComplete(int status){
    System.out.println("Status:"+status);
    This code did not behavior as I had expected. I thought imageComplete could be called for only once. But it will be called twice, value status is 3(STATICIMAGEDONE) for the first time, but 1 for the second call, which indicates an image error.
    I don't know why, can you give me the answer? javalogo.gif is a static picture.

    pls help me with this, thanks

Maybe you are looking for