Backing file init method always called for proxy portlets

Hello,
We are currently using Weblogic Portal 10 MP1. Deployed within our Portal EAR is a local proxy portlet and attached to this proxy portlet is a backing file, which currently implements the init() and prerender() methods from the backing interface.
When this is placed in a page that is within a desktop, the init() method is always invoked no matter which page you access within the desktop. As I understand it from the documentation, if you have "tree optimization" turned on, then the init() method will only be called when rendering the actual page the proxy portlet is in. But this doesn't seem to be the case. However, if I define a standard Java portlet within the EAR and attach a backing file, then the init() follows the rules when tree optimization is turned on or off.
Does anyone know if this is a defect within the portal framework, or is this expected and proxy portlets do not follow this rule?
And I guess, if it is a defect or known limitation, is there a possible workaround? I assume the simplest workaround will be to move the logic into the prerender() method.
Regards,
Jonathan

Hello Jonathan,
Tree optimization is a tricky thing- some portlets may still be initialized even when the page they are on isn't visible. The rules for which get initialized and which don't are very complicated and depend on a number of things, so it is just best to not rely on the init() method not getting called.
By far the best option for your use-case is to have the proxy portlet listen to the "onRefresh" event, and move the logic from the backing file's init() method into an event-handling method in the backing file, then have this method called when the refresh event is received. Here's a sample portion of the .portlet file for doing this:
<netuix:handlePortalEvent event="onRefresh" eventLabel="onRefreshEvent">
    <netuix:invokeBackingFileMethod method="handleRefreshEvent"/>
</netuix:handlePortalEvent>The "onRefresh" event is sent to the portlet only when it is visible on the page, so it should work perfectly for your use-case.
Kevin

Similar Messages

  • Init method is called multiple times

    Hi,
    init method in my servlet is called more than 1 time.
    I think it is supposed to be called only 1 time,when the application is loaded.
    anything to do with web.xml ???
    or else what r the situations that init method is called more than 1 time
    thanks

    Hi,
    actually I figured out the problem.
    I am using logger staements for debugging.
    I am also using singlethread model for servlet.
    I came to know that it creates multiple instances of servlet...
    which inturn calls init method multiple times.
    i took out that singlethread model,now it is working perfect.
    Thanks

  • How and when the realDelete method gets called for a custom adapter?

    Hi,
    I am a newbie in sun identity manager and is in the process of writing a custom adapter for documentum resource.
    While I am successful in creating the resource,then provisioning the resource to an user(i.e creating an account of the user on documentum ) updating the user through idm I am not being able to deprovision the resource.
    Actually in the trace I am not seeing the realDelete method getting called anywhere,but I am sure if it gets called it would do its designated job bcos as a standalone code it's working.
    Does this mean I am not properly doing deprovisioning in sun-idm?
    What method I am employing is in the assignment list of the user,i am putting the resource from assigned to unassigned side(i.e right to left side) just as in case of provisioning I have put it from left to right.
    Is it the standard way of deprovisioning or am I missing something here?
    Any sort of help would be highly appreciated.
    Thanks
    anjan

    You need to read that manual with more caution. It has all info you need.
    1. Table modification info stays in shared pool and flushed into dictionary by Oracle automatically. You can explicity do it by calling dbms_stats.flush_database_monitoring_info.
    2. dba_tab_modifications view = How many DML are applied to target table?
    dba_tab_statistics.stale_stats = Is statistics stale?
    3. When you call dbms_stats.gather... familiy, Oracle flushed the stale info to disk. You gnerally don't need to care about that.
    4. Statistics is considered to be stale, when the change is over 10% of current rows.
    (As of 11g, this value can be customized per objects. Cool feature)
    create table t_stat(id int);
    insert into t_stat select rownum from all_objects where rownum <= 100;
    commit;
    exec dbms_stats.gather_table_stats(user, 'T_STAT');
    select * from sys.dba_tab_modifications where table_name = 'T_STAT';
    No row selected
    select stale_stats from sys.dba_tab_statistics where table_name = 'T_STAT';
    NO
    insert into t_stat select rownum from all_objects where rownum <= 20;
    select * from sys.dba_tab_modifications where table_name = 'T_STAT';
    No rows selected <-- Oops
    select stale_stats from sys.dba_tab_statistics where table_name = 'T_STAT';
    NO  <-- Oops
    exec dbms_stats.flush_database_monitoring_info;
    select * from sys.dba_tab_modifications where table_name = 'T_STAT';
    TABLE_OWNER     TABLE_NAME     PARTITION_NAME     SUBPARTITION_NAME     INSERTS     UPDATES     DELETES     TIMESTAMP     TRUNCATED     DROP_SEGMENTS
    UKJA     T_STAT               20     0     0     2008-01-18 PM 11:30:19     NO     0
    select stale_stats from sys.dba_tab_statistics where table_name = 'T_STAT';
    YES

  • Stop() method always called on browser close?

    In my web application I pop up an applet and I need to do some processing whenever the the user closes the applet window. I learnt that the Applet class' stop() method is called whenver the page containing the applet is either closed/refreshed/redirected.
    My question is whether I can rely that the stop() method will always be called in such aforementioned situations? Also it this kind of functionality browser dependent (i.e. are there some commonly used browsers that behave a bit differently?)

    It SHOULD work, but I wouldn't bet anything important on it working. If the closing code is critical you've got to test at least IE, Netscape/Mozilla, Firefox and Opera and you've got to test lots of versions of each.
    I'd try hard to design around this issue.

  • ITune updates on my XP always call for AOL?

    When I update my iTunes, the software for Aol always comes up. I do not have AOl and my computer settings on my computer say never dial up. Even when my web browser is open already, iTunes calls for AOL. It is maddening. Is there a setting in iTunes that I need to switch off?

    When I update my iTunes, the software for Aol always
    comes up. I do not have AOl...
    If you do not have AOL, then how does the AOL software come up?
    Why not remove the AOL software entirely? Just dump it. It's bad for you. It's bad for your computer. It's just bad.

  • Setter is not always called for a h:inputText

    It is really very strange beahvioure in a JSF componenet <h:inputText ..../>.
    Sometimes the entered value is mapped to its corresponding field in the bean (value="#{mybean.someproperty}") and sometime it negelects the user data and keep the value is "" ? even if the user entered data to that text box ?
    There is no validation for that component.
    Any idea or help is greatly appreciated

    Thanks a lot BalusC for offering continous help;
    Actaully I found the probelm !
    I have 20 tables in a JSF page, each table represents a single Service.
    so I have Service1,Service2,......Service20
    <table width="100%"  border="0" cellspacing="0" cellpadding="0" class="eBasicInfoTB">                                   
                                       <tr class="cnt_tabl_bg">
                                            <td colspan="4" class="cnt_title_bg">
                                                 <div align="left">
                                                 <h:selectBooleanCheckbox id="service1" binding="#{approvalManagementBean.selectBooleanService1}"></h:selectBooleanCheckbox>
                                                 Service #1</div>
                                            </td>
                                       </tr>
                                       <tr class="cnt_tabl_bg">
                                            <td width="25%" class="td_alr">Service Date</td>
                                            <td width="24%">
                                                 <table    border="0" cellspacing="0" cellpadding="0" class="ClaTB">
                                                      <tr>
                                                           <td width="100%"><h:outputText id="service1_date" value="#{approvalManagementBean.service1.serviceDateStr}" styleClass="fieldNormalClassDBlue"></h:outputText></td>
                                                      </tr>
                                                 </table>
                                            </td>
                                            <td width="25%" class="td_alr">Service Code</td>
                                            <td width="26%"><h:outputText id="service1_code" value="#{approvalManagementBean.service1.serviceCode}" styleClass="fieldNormalClassDBlue"></h:outputText>
                                            </td>
                                       </tr>
                                       <tr class="cnt_tabl_bg">
                                            <td class="td_alr">Service Description</td>
                                            <td colspan="3"><h:outputText id="service1_desc" value="#{approvalManagementBean.service1.serviceDesc}" styleClass="fieldNormalClassDBlue"></h:outputText>
                                            </td>
                                       </tr>
                                       <tr class="cnt_tabl_bg">
                                            <td class="td_alr">Unit Price</td>
                                            <td><h:outputText id="service1_unitPrice" value="#{approvalManagementBean.service1.unitPrice}" styleClass="fieldNormalClassDBlue"></h:outputText>
                                            </td>
                                            <td class="td_alr"> Unit Type</td>
                                            <td>
                                                 <h:outputText id="service1_unitType" value="#{approvalManagementBean.service1.unitType}" styleClass="fieldNormalClassDBlue"></h:outputText>                                             
                                            </td>
                                       </tr>
                                       <tr class="cnt_tabl_bg">
                                            <td class="td_alr">Quantity</td>
                                            <td><h:outputText id="service1_reqQty" value="#{approvalManagementBean.service1.reqQuantity}" styleClass="fieldNormalClassDBlue"></h:outputText></td>
                                            <td class="td_alr"> Requested Cost</td>
                                            <td><h:outputText id="service1_reqCost" value="#{approvalManagementBean.service1.reqCost}" styleClass="fieldNormalClassDBlue"></h:outputText></td>
                                       </tr>
                                       <tr class="cnt_tabl_bg">
                                            <td class="td_alr">Provider Service Comments</td>
                                            <td colspan="3"><h:outputText id="service1_provComments" value="#{approvalManagementBean.service1.provComments}" styleClass="fieldNormalClassDBlue"></h:outputText></td>
                                       </tr>
                                  </table>The field that had the bug was the field Requested Cost
    value="#{approvalManagementBean.service1.reqCost}"I found that Service No19 aslo has
    value="#{approvalManagementBean.service1.reqCost}"which was overrides the first value if it left empty :)
    Thanks again our Expert

  • Why Do We Have To Call super.init(config); in init() method of servlet?

    Hi, everyone..
    I wonder why we call super.init(config) in init method of servlet... If i dont call it ; when i try to get servletcontext in service method it throws java.lang.NullPointerException...when we call super.init() , what is happening behind the scene? If anybody has a technical explanation for my question , i will be very pleased...
    THX FOR YOUR FUTURE REPLIES IN ADVANCE....

    I am sorry about the uppercases and i dont want to seem smart on java forums... Anyway, m8 this is the thing that i know... i meant; for instance when we override doGet or doPost method ; we dont need to override init method; but the server loads the servlet and we can get the context of the servlet in these methods easily by calling getServletContext() method; however when we want to call service method implicitly by jndi, servlet needs to be loaded and init method must call its parent...(i also write down in web.xml <load-on-startup>.... for that servlet).
    thx for your replies in advance....

  • Backing file running before or after jsp

    Hello,
    The documentation about backing files said :"All backing files are executed before and after the JSP is called".
    When the backing file runs is there anyway to know if it is running before the jsp is called or if it is running after the jsp has beed called?.
    Thx.

    so the methods on the backing file
    init()
    handlePostbackData()
    preRender()
    run before the JSP
    dispose()
    runs after
    hope this clears that up
    Chris Jolley
    Portal Architect

  • Empty init() methods

    I am currently working on and cleaning up (old) Java servlet code that I inherited from another collegue. In a lot of the servlets, I find empty init() methods like:
    public void init() {
    }As a novice to Java servlets, I have just been reading the First Edition of Jason Hunter's 'Java Servlet Programming' book. There, on page 59 it is stated that every servlet's init() method should call super.init(config) as its first action. I was wondering if I could simply remove the empty init() methods that I encounter in the servlets... If i remove them, the init() method of the superclass will get called... and the behaviour of the superclass init() might be slightly different than an emtpy init() method... isn't it? But I wonder if it will make a big deal for my application...
    Are there any possible side effects to expect here? What could probably happen if remove the empty init() methods and consequently start using the init() method from the superclass?

    OK. Yesterday, I cleaned up all empty init() methods, now it's time for cleaning up all unnecessary init(ServletConfig cfg) methods. In the servlet code that i inherited from a collegue, I find a lot of servlets containing the following:
        public void init(ServletConfig cfg) throws ServletException {
            super.init(cfg);
        }In the meanwhile, i know that we are using Tomcat 5.5 as a container, so I looked into the Tomcat HttpServlet implementation and I found no init(ServletConfig cfg). I then looked at GenericServlet where i found:
        public void init(ServletConfig config) throws ServletException {
            this.config = config;
            this.init();
        }and since the init() method also doesn't do much, i think i can safely remove all
        public void init(ServletConfig cfg) throws ServletException {
            super.init(cfg);
        }methods in our own servlets... since what they do is actually just the same as the init(ServletConfig cfg) method from GenericServlet.
    Can somebody who is more experienced in Java Servlets than me confirm?
    Thanks!
    Bart

  • Portlet backing file and include

    If I have a backing file, is there way to include another page in the
    handlePostback() method or preRender() method? Don't want to change the
    whole page, just the contents of the portlet...

    According to the documentation, here is the difference:
    Scoping and Backing Files
    The difference between having a backing file as part of <netuix: portlet backingfile =some_value> or part of <netuix: jspContent backingfile=some_value> is related to scoping.
    For example, if you have the backing file on the portlet itself, you can actually stop the portlet from rendering. If the backing file is at the jspContent level, the portlet portion of the control tree has already run; you use this implementation to run processes that are specifically for the JSP in the portlet.
    See http://download.oracle.com/docs/cd/E13155_01/wlp/docs103/portlets/building.html#wp1077130 for more info.
    Brad

  • Overwrite init() method???

    Hi,
    How to overwrite init() method.?? is this possible ????
    write code how to do

    jsf_VWP5.5.1 wrote:
    Hi,
    How to overwrite init() method.?? is this possible ????
    write code how to dothe init method is called only once. In the init method we usually mention the database driver...like say for example--->
    public void init(ServletConfig servletconfig)
            throws ServletException
            super.init(servletconfig);
            try
                Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                return;
            catch(ClassNotFoundException classnotfoundexception)
                log("Couldn't load class sun.jdbc.odbc.JdbcOdbcDriver");
                throw new ServletException(classnotfoundexception.getMessage());
        }here the necessary drivers get loaded.
    hope you get the point:)
    regards,
    a_joseph

  • Portlet backing file vs content backing file

    Hi,
    could someone explain the differences between a "portlet backing file" and a "content backing file". Both are properties available on a portlet.
    Thx
    Emmanuel

    According to the documentation, here is the difference:
    Scoping and Backing Files
    The difference between having a backing file as part of <netuix: portlet backingfile =some_value> or part of <netuix: jspContent backingfile=some_value> is related to scoping.
    For example, if you have the backing file on the portlet itself, you can actually stop the portlet from rendering. If the backing file is at the jspContent level, the portlet portion of the control tree has already run; you use this implementation to run processes that are specifically for the JSP in the portlet.
    See http://download.oracle.com/docs/cd/E13155_01/wlp/docs103/portlets/building.html#wp1077130 for more info.
    Brad

  • Printing in servlet's init() method

    i am trying to print out some information in init() method, but i can not create a 'response' object of ServletResponse to print with out.prinln() method for displaying these information in browser. please help me for working it out. i have given code below.
    public void init(ServletConfig config) throws ServletException {
            //response.setContentType("text/html;charset=UTF-8");
            //PrintWriter out = res.getWriter();
            Enumeration parameters = config.getInitParameterNames();
            while(parameters.hasMoreElements()) {
                String parameter = (String)parameters.nextElement();
                System.out.println("Parameter name: " + parameter);
                System.out.println("Parameter value: " + config.getInitParameter(parameter));
        }

    You don't 'create' a response object, the container does it and passes it to your code.
    You don't service requests in the init method, it's for initialization. You only setup stuff that you want to use later there.
    And in any case, do you even see 'response' declared anywhere?
    Move your code to a doGet() or doPost() method.
    People on the forum help others voluntarily, it's not their job.
    Help them help you.
    Learn how to ask questions first: http://www.catb.org/~esr/faqs/smart-questions.html
    ----------------------------------------------------------------

  • When the init mehtod is called

    When the init mehtod is called?
    while running the server or by running the servlet program.
    When u create a enterprice project in WSAD you will have JavaResource and Web Content in your project.
    Say i have 10 servlet program in my JavaResource.
    When running the JavaResource by right cliking and run on this server which servlet will run first and when will the init method is called.
    ** (I am using Websphere)**_

    If you have gone thorugh the servlet life cycle methods, you could have come to know when init method is called.
    Servlet�s life cycle is controlled by the container in which the servlet has been deployed. When a request is mapped to a servlet, the container performs the following steps. If an instance of the servlet does not exist, the Web container
    a.     Loads the servlet class.
    b.     Creates an instance of the servlet class.
    c.     Initializes the servlet instance by calling the init method. Initialization is covered in Initializing a Servlet. 2.     Invokes the service method, passing a request and response object.
    If the container needs to remove the servlet, it finalizes the servlet by calling the servlet's destroy method.
    I think now you can understand when init method is called.

  • Init() method: private vs. public

    I have a question:
    What is the difference in defining your init() method in a servlet as private vs. public since it is automatically executed when the class is instantiated?
    thanks

    cbreneman,
    For future reference,
    public void foo() {
        method vailable to all
    protected void foo() {
        method vailable to pacakge
    private void Foo() {
        method vailable to this
    }You can do this:
    public String bar;
    protected String bar;
    private String bar;You cannot do this:
    private void Foo() {
        public String bar = "Oops!";
    }For an Applet, init() is inherited when you extend the Applet class. It must be overidden if you have work to do before your subclass becomes active. It is defined by the superclass as public and void. If you were to create an init() method that was private and returned a String, you might (the compiler will stop you if you try to define init() twice) have a different method, but you would not have overidden public void init(). If you tried something like private void init() the compiler would stop you:
    init() in FooBar cannot override init() in java.applet.Applet; attempting to assign weaker access privileges; was public
    private void init() {
    ^
    1 error
    Make sense?
    With servlets, the init() method is there for slightly different reasons and to be honest, I am not sure that you inherit it? I believe it acts as a special constructor? I don't write many servlets, so I'll shut up and let someone who does give a better answer.
    Hope this helps.

Maybe you are looking for

  • App Store won't open on OS X Yosemite 10.10.2

    I recently updated my mac to OS X Yosemite Version 10.10.2 and during this a power cut happened. When I had finally got power back and turned on my mac it when to installing the new update as if I had just brought the mac brand new and was turning it

  • How do I capture video recording made by DVD Handycam?

    Hi, I have used a Sony DVD Handycam as a second camera during a gig. I can't capture this to Final Cut Express 4, Not I to iMovie, either! I can watch the recording on my Mac via a USB cable in DVD player (maybe this isn't relevant). The camera has n

  • Support for SX-10

    Is the new low cost SX-10 supported on the Webex TP service?  

  • Help Installing JRE in windows XP

    I have been unable to install. Everytime I try I get the folliwing error message: "J2re_1_4_1_01-windows-i586.exe-Application Error The application failed to initialize properly (0xc0000005). Click on ok to terminate application." I am logged in as a

  • Webservice for ICI to interogate CRM based on Calling Line ID

    Hello We are just starting looking at linking our telephony to CRM IC using the standard Web Services provided in the ICI but I cannot find any information/example on which WSDL I need to use to achieve my objective. We are basically trying to start