Calling init method on backing bean when JSP loads

Hi All,
My problem seems simple, but I'm not having much luck finding a solution.
I have a JSF page that shows the details of an employee. So I have an employee.jsp with a backing bean EmployeeController which works fine.
The change I need to make is this: pass in an employeeId to the URL and let my controller read it.
I've tried the following in my faces-config.xml:
<managed-bean>
  <managed-bean-name>exmployeeBean</managed-bean-name>
  <managed-bean-class>
    com.acme.EmployeeController
  </managed-bean-class>
  <managed-bean-scope>session</managed-bean-scope>
  <managed-property>
    <property-name>employeeId</property-name>
    <value>#{requestScope.employeeId}</value>
  </managed-property>
</managed-bean>And the following in my backing bean:
public void setEmployeeId(String employeeId) {
  logger.info("METHOD CALLED");
  this.refreshValuesForEmployee(employeeId);
}But I'm not having any luck (ie - this method is not being called).

it's ok. i found out why it wasn't working.
my scope was set to "session", but had to be "request" so that i could use the params syntax.
thanks anyway.

Similar Messages

  • How to call a method in backing bean on hitting 'Enter' key on a page.

    Hi all,
    I would be obliged if any one can provide me solution for the below given problem.
    My requirement is to call a method in backing bean when i hit 'Enter' key on a JSP page.
    I am trying this by using a script given below.
    *function fnChangeFocus(){*
    *if(window.event.keyCode==13){*
    * document.getElementById("mainform:submitForm:commandbutton").focus();*
    The JSP has the textbox as given below.
    *<h:inputText id="inputtxtboxid" disabled="false" value="#{Bean.inputvalue}"*
    onkeypress="fnChangeFocus()" size="24" />
    Using this I could not acheive the required functionality. Please suggest some alternative.
    Thanks,
    Jagadeesh Pala

    Only a form element supports the submit() function. Make sure that the getElementById returns the appropriate form. Or rather pass the element as the 'this' reference to the function and get the parent form from it.
    After all this is just basic DHTML / Javascript+DOM knowledge and in fact this has nothing to do with JSF. For future basic DHTML / JS+DOM questions you may take a look at the appropriate forums, e.g. dhtmlcentral.com, dynamicdrive.com, etcetera.

  • Calling a method on backing bean in response to contextual event

    Hi
    I am using Jdeveloper 11.1.1.6.0 and using ADF contextual events..
    I have a drop down list and i am rasiing a contextual event on changing the current selection. In response to that event i want to call a backing bean method with parameters.. But when i click on the subscriber section for the contextual event, i can see only some bindings of the page.. How can i call a method on backing bean as a subscriber..
    Thanks
    Raghu

    Hi,
    this article has a use case for the POJO approach: http://www.oracle.com/technetwork/issue-archive/2011/11-may/o31adf-352561.html
    Another is to define a method binding in the receiving PageDef file and configure it as explained here
    http://java.net/projects/smuenchadf/pages/ADFSamplesBindings/revisions/3#SMU164
    Frank

  • Calling a method in a bean when i clcked on the radio button of a table

    Hi,
    I need to call a method in the bean when i clicked on the radio button of a table
    I tried it , by callling the method in selectionListener..
    I can able to execute only System.out.prinln method,
    rather than that i am unable to execute any other expression..
    like setting rendering property to a component.
    Thanks in advance,

    Hi,
    what you say is not true. You can execute any code within a selection listener you want. If you can print then it shows the method s called and you can execute whatever you want within this method
    Frank

  • Browser Dependency when calling a method in backing bean using a javasript.

    Hi all,
    I have a problem which may look simple but bugging me for quite some time.
    The problem is : When I call a method in the backing bean using a Javascript, (the method can alternatively be invoked by clicking on a command link) I am facing an exception (stack printed below).
    The strange part is that...I am getting this exception only when I use Internet Explorer. It works absolutely fine when I use Mozilla or Netscape browsers. Also, even in ie, it is working fine when I click on the link directly. The probem comes only when I invoke the action using a javascript.
    WARN [lifecycle] executePhase(RENDER_RESPONSE 6,com.sun.faces.cont
    ext.FacesContextImpl@16ce9df) threw exception
    javax.faces.FacesException
         at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java
    :135)
         at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
         at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
    FilterChain.java:290)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
    ain.java:206)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
    FilterChain.java:235)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
    ain.java:206)
         at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.ja
    va:96)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
    FilterChain.java:235)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
    ain.java:206)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
    va:230)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
    va:175)
         at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssoci
    ationValve.java:179)
         at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:
    84)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104
         at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnecti
    onValve.java:156)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
    :109)
         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http
    11Protocol.java:580)
         at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
         at java.lang.Thread.run(Unknown Source)
    Caused by: ClientAbortException: java.net.SocketException: Connection reset by
    peer: socket write error
         at org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:
    358)
         at org.apache.tomcat.util.buf.ByteChunk.flushBuffer(ByteChunk.java:434)
         at org.apache.catalina.connector.OutputBuffer.doFlush(OutputBuffer.java:309)
         at org.apache.catalina.connector.OutputBuffer.flush(OutputBuffer.java:288)
         at org.apache.catalina.connector.Response.flushBuffer(Response.java:542)
         at org.apache.catalina.connector.ResponseFacade.flushBuffer(ResponseFacade.java
    :279)
         at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:20
    2)
         at org.ajax4jsf.framework.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java
    :101)
         at org.ajax4jsf.framework.ajax.AjaxViewHandler.renderView(AjaxViewHandler.java:
    222)
         at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java
    :106)
         ... 24 more
    Caused by: java.net.SocketException: Connection reset by peer: socket write erro
    r
         at java.net.SocketOutputStream.socketWrite0(Native Method)
         at java.net.SocketOutputStream.socketWrite(Unknown Source)
         at java.net.SocketOutputStream.write(Unknown Source)
         at org.apache.coyote.http11.InternalOutputBuffer$OutputStreamOutputBuffer.doWri
    te(InternalOutputBuffer.java:764)
         at org.apache.coyote.http11.filters.ChunkedOutputFilter.doWrite(ChunkedOutputFi
    lter.java:124)
         at org.apache.coyote.http11.InternalOutputBuffer.doWrite(InternalOutputBuffer.j
    ava:570)
         at org.apache.coyote.Response.doWrite(Response.java:560)
         at org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:
    353)
         ... 33 more
    13:54:42,805 ERROR [STDERR] ClientAbortException: java.net.SocketException: Con
    nection reset by peer: socket write error
    13:54:42,805 ERROR [STDERR]      at org.apache.catalina.connector.OutputBuffer.realW
    riteBytes(OutputBuffer.java:358)
    13:54:42,805 ERROR [STDERR]      at org.apache.tomcat.util.buf.ByteChunk.flushBuffer
    (ByteChunk.java:434)
    13:54:42,805 ERROR [STDERR]      at org.apache.catalina.connector.OutputBuffer.doFlu
    sh(OutputBuffer.java:309)
    13:54:42,805 ERROR [STDERR]      at org.apache.catalina.connector.OutputBuffer.flush
    (OutputBuffer.java:288)
    13:54:42,820 ERROR [STDERR]      at org.apache.catalina.connector.Response.flushBuff
    er(Response.java:542)
    13:54:42,820 ERROR [STDERR]      at org.apache.catalina.connector.ResponseFacade.flu
    shBuffer(ResponseFacade.java:279)
    13:54:42,820 ERROR [STDERR]      at com.sun.faces.application.ViewHandlerImpl.render
    View(ViewHandlerImpl.java:202)
    13:54:42,820 ERROR [STDERR]      at org.ajax4jsf.framework.ViewHandlerWrapper.render
    View(ViewHandlerWrapper.java:101)
    13:54:42,820 ERROR [STDERR]      at org.ajax4jsf.framework.ajax.AjaxViewHandler.rend
    erView(AjaxViewHandler.java:222)
    13:54:42,820 ERROR [STDERR]      at com.sun.faces.lifecycle.RenderResponsePhase.exec
    ute(RenderResponsePhase.java:106)
    13:54:42,820 ERROR [STDERR]      at com.sun.faces.lifecycle.LifecycleImpl.phase(Life
    cycleImpl.java:251)
    13:54:42,820 ERROR [STDERR]      at com.sun.faces.lifecycle.LifecycleImpl.render(Lif
    ecycleImpl.java:144)
    13:54:42,820 ERROR [STDERR]      at javax.faces.webapp.FacesServlet.service(FacesSer
    vlet.java:245)
    13:54:42,820 ERROR [STDERR]      at org.apache.catalina.core.ApplicationFilterChain.
    internalDoFilter(ApplicationFilterChain.java:290)
    13:54:42,820 ERROR [STDERR]      at org.apache.catalina.core.ApplicationFilterChain.
    doFilter(ApplicationFilterChain.java:206)
    13:54:42,820 ERROR [STDERR]      at com.hds.vc.common.infrastructure.AIMFilter.doFil
    ter(AIMFilter.java:27)
    13:54:42,820 ERROR [STDERR]      at org.apache.catalina.core.ApplicationFilterChain.
    internalDoFilter(ApplicationFilterChain.java:235)
    13:54:42,820 ERROR [STDERR]      at org.apache.catalina.core.ApplicationFilterChain.
    doFilter(ApplicationFilterChain.java:206)
    13:54:42,820 ERROR [STDERR]      at org.jboss.web.tomcat.filters.ReplyHeaderFilter.d
    oFilter(ReplyHeaderFilter.java:96)
    13:54:42,820 ERROR [STDERR]      at org.apache.catalina.core.ApplicationFilterChain.
    internalDoFilter(ApplicationFilterChain.java:235)
    13:54:42,820 ERROR [STDERR]      at org.apache.catalina.core.ApplicationFilterChain.
    doFilter(ApplicationFilterChain.java:206)
    13:54:42,820 ERROR [STDERR]      at org.apache.catalina.core.StandardWrapperValve.in
    voke(StandardWrapperValve.java:230)
    13:54:42,820 ERROR [STDERR]      at org.apache.catalina.core.StandardContextValve.in
    voke(StandardContextValve.java:175)
    13:54:42,820 ERROR [STDERR]      at org.jboss.web.tomcat.security.SecurityAssociatio
    nValve.invoke(SecurityAssociationValve.java:179)
    13:54:42,820 ERROR [STDERR]      at org.jboss.web.tomcat.security.JaccContextValve.i
    nvoke(JaccContextValve.java:84)
    13:54:42,820 ERROR [STDERR]      at org.apache.catalina.core.StandardHostValve.invok
    e(StandardHostValve.java:128)
    13:54:42,820 ERROR [STDERR]      at org.apache.catalina.valves.ErrorReportValve.invo
    ke(ErrorReportValve.java:104)
    13:54:42,820 ERROR [STDERR]      at org.jboss.web.tomcat.service.jca.CachedConnectio
    nValve.invoke(CachedConnectionValve.java:156)
    13:54:42,820 ERROR [STDERR]      at org.apache.catalina.core.StandardEngineValve.inv
    oke(StandardEngineValve.java:109)
    13:54:42,820 ERROR [STDERR]      at org.apache.catalina.connector.CoyoteAdapter.serv
    ice(CoyoteAdapter.java:241)
    13:54:42,820 ERROR [STDERR]      at org.apache.coyote.http11.Http11Processor.process
    (Http11Processor.java:844)
    13:54:42,820 ERROR [STDERR]      at org.apache.coyote.http11.Http11Protocol$Http11Co
    nnectionHandler.process(Http11Protocol.java:580)
    13:54:42,820 ERROR [STDERR]      at org.apache.tomcat.util.net.JIoEndpoint$Worker.ru
    n(JIoEndpoint.java:447)
    13:54:42,820 ERROR [STDERR]      at java.lang.Thread.run(Unknown Source)
    13:54:42,820 ERROR [STDERR] Caused by: java.net.SocketException: Connection rese
    t by peer: socket write error
    13:54:42,820 ERROR [STDERR]      at java.net.SocketOutputStream.socketWrite0(Native
    Method)
    13:54:42,820 ERROR [STDERR]      at java.net.SocketOutputStream.socketWrite(Unknown
    Source)
    13:54:42,820 ERROR [STDERR]      at java.net.SocketOutputStream.write(Unknown Source
    13:54:42,820 ERROR [STDERR]      at org.apache.coyote.http11.InternalOutputBuffer$Ou
    tputStreamOutputBuffer.doWrite(InternalOutputBuffer.java:764)
    13:54:42,820 ERROR [STDERR]      at org.apache.coyote.http11.filters.ChunkedOutputFi
    lter.doWrite(ChunkedOutputFilter.java:124)
    13:54:42,820 ERROR [STDERR]      at org.apache.coyote.http11.InternalOutputBuffer.do
    Write(InternalOutputBuffer.java:570)
    13:54:42,820 ERROR [STDERR]      at org.apache.coyote.Response.doWrite(Response.java
    :560)
    13:54:42,820 ERROR [STDERR]      at org.apache.catalina.connector.OutputBuffer.realW
    riteBytes(OutputBuffer.java:353)
    13:54:42,820 ERROR [STDERR]      ... 33 more
    Please throw some light on this issue.

    This is the Java script I am using
    function submitForm(e){
         var characterCode
         if(e && e.which){
         e = e
         characterCode = e.which
         }else{
         e = event                    characterCode = e.keyCode
         if (characterCode== 13){
         document.getElementById('mainform:submitForm:search').onclick();
    Regards,
    Jagadeesh
    Edited by: Jagadeesh.Pala on Oct 1, 2007 3:59 AM

  • Calling a method in backing bean whenever a page is loaded/reloaded

    Hi,
    What is the best way to call a certain method in a backing bean whenever the jsp page is reloaded?
    I have a managed bean that provides the data for a form and the bean gets it's data from a SQL DB. I want the bean to reload the data from the DB when and only when the page is loaded or reloaded. (I.e. it should the call method loadData() )
    What is the best way to do this?
    /R

    If the bean is request scoped, just call the logic in the init block or in the constructor, or even in the accessor.
    If the bean is session scoped, call the logic in the accessor.
    http://balusc.xs4all.nl/srv/dev-jep-dat.html might give some insights.

  • Firing a method of backing bean on Page Load

    Hi all,
    Can anyone tell me how a method of the backing bean can be fired when the corresponding jsf page loads in the browser...
    in fact some data is to be fetched from the server at the time of page load and rendered in one of the fields ... kindly help me in this regard ...
    thanks in advance,
    Neeraj Upreti

    You can use a constructor or initialization block of the bean for this or maybe even introduce lazy loading in the getters, all depending on the expensiveness of the actual logic.
    If you're using JSF 1.2, you can also use the beforePhase attribute of the <f:view> to specify a method which is to be fired on beforePhase of the view. You can also add @PostConstruct annotations to the methods which are to be fired on construction of the bean.

  • Calling function from Backing Bean or JSP page

    We are on Jdeveloper 10.1.3.3.0, ADF Faces, JSF Faces .., Currently there is a function call from Javascript event (onmouseover) in the JSP page. I want to call this function from a backing bean or JSP page, as I have to pass some values to this function.
    For Ex., I have a function call like return submit('A','B','Test'); on the Javascript event (onmouseover) in jsp page. I want to remove this function from the javascript event and call from backing bean or jsp page to pass some values into the submit() function. I appreciate if anyone can give some example of how to call this function from backing bean or jsp page in the <SCRIPT> or <SCRIPTLET>
    Thanks,
    Ram

    A use case would be helpful so that we can get a better idea of what you want to do.
    As a general rule, there is no way to call a client side Javascript function from a backing bean, which is server side. However, there are ways to inject information from a backing bean into your Javascript call. For instance, I have an application that uses Google Maps API. It has an onload call to a Javascript function that builds the map and designates it's center point. The center point comes from a backing bean as latitude and longitude properties. So here is my body tag:
    <afh:body onload="initialize(#{backing_searchResults.latitude},#{backing_searchResults.longitude},#{searchCriteria.distance})"
              onunload="GUnload()">onload calls the Javascript function called initialize, and passes the latitude, longitude, and distance from the bean. Is the function really being called from my backing bean? No - the parameters are hard coded into the onload event code when the page is rendered. Does it do the job? Sure it does.

  • Moving Scriptlet Code to backing bean when converting from JSP - Facelets

    Hello!
    We are converting our application from jsf1.2 to 2.0 and all jsps are being converted to XHTML. Some are trivial while others had very complex scriptlets.
    I would like to know what are some of the recommended ways of moving Scriptlet Code to backing bean when converting from JSP -> Facelets.
    I have thought about listeners, actionListeners, putting code getXXXX() of the backing bean and then calling #{bean.XXXX} but not sure whats the best way.
    I do appreciate the response!
    Eg of a jsp page:
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
    <%@ taglib uri="/WEB-INF/xxx-jsf.tld" prefix="l" %>
    <%@ taglib uri="/WEB-INF/yyy-pp.tld" prefix="p" %>
    <%@ page import="com.ttyy.search.beans.jsf.AdvancedSearchFormManagedBean" %>
    <%@ page import="com.kkee.util.*"%>
    <%
        AdvancedSearchFormManagedBean advancedSearchFormManagedBean = (AdvancedSearchFormManagedBean) request.getSession().getAttribute("AdvancedSearchFormManagedBean");
        if (advancedSearchFormManagedBean == null) {
           advancedSearchFormManagedBean = new AdvancedSearchFormManagedBean();
           request.getSession().setAttribute("AdvancedSearchFormManagedBean", advancedSearchFormManagedBean);
        advancedSearchFormManagedBean.initializeForAdvancedSearchOptions();
        advancedSearchFormManagedBean.setQuickSearch();
         request.setAttribute("portletHeader", "Hello " + advancedSearchFormManagedBean.getPerson().getFirstname() + ", check out the latest programs in your practice areas and jurisdictions");
    %>
    <h:form id="MYCenterForm">
         <p:portletRenderer portletSetName="test of portlet"
              portletContainer="#{PortletContainerManagedBean}"
              id="MYCenter"
              portletScope = "TEST_SCOPE"
              suppressIfNoData="true"
              portletSkinName="SOME_SKIN">
              <f:facet name="persistenceToolkit">
                   <h:commandLink id="persistenceToolkitLink"
                        actionListener="#{PortletContainerManagedBean.persistPortletSetStateListener}">
                        <h:outputText value="Save State Of Portlet Set" id="persistenceToolkitLinkText"/>
                   </h:commandLink>
              </f:facet>
         </p:pagePortletSetRenderer>
    </h:form>
    <%
         String flag = PropertyItems.getInstance().getPropertyItem("response.time.flag");
         if("1".equals(flag)){
              ResponseTime rt = (ResponseTime) session.getAttribute("responseTime");
            if(rt!=null){
                rt.setDesc("my cle loaded");
                long now = System.currentTimeMillis();
                long start = rt.getStart() + rt.getTotal();
                rt.setInterval(now-start);
                rt.setTotal(rt.getTotal()+rt.getInterval());
                LogUtil.log(rt.toString(), LogUtil.DEBUG_LEVEL);
                session.setAttribute("responseTime", rt);
    %>

    That helps.
    This could be another topic question but itst kind of related to what i am doing right now. while converting JSP to facelet (in jsf2) I came across another issue.
    <h:commandLink id="Save" rendered="#{RegistrationBean.isNOTInOrigionalRegistrationMode}" action="#{RegistrationBean.updateProfile2Submit}" styleClass="#{portalSkinManagedBean.contentPortletSkin.strongTextStyle}">
              <l:htmlSkinnedImage id="SaveImage" style="border:0;" url="save.gif" alt="Save Information"/>
    </h:commandLink>When I click on the generated link, I get this. And this is happening for all the h:commandLink in the application.
    http://localhost:9080/registration/updateProfile2.jsf[request.getQueryString()=null][request.getRequestedSessionId()=F1CCE237DD81D301F1C4DBA6910FFD8A][request.isRequestedSessionIdFromCookie()=true][request.isRequestedSessionIdFromURL()=false][request.isRequestedSessionIdValid()=true]Parameters:[rolePracticeAreasForm:title=rolePracticeAreasForm:primaryPracticeArea=10002javax.faces.ViewState=-2943345291093118815:-4400303399130292206rolePracticeAreasForm:practiceAreasMod2=10148.1rolePracticeAreasForm:practiceAreasMod1=10002.1rolePracticeAreasForm:Save=rolePracticeAreasForm:SaverolePracticeAreasForm=rolePracticeAreasFormrolePracticeAreasForm:otherField=rolePracticeAreasForm:fromMyAccount=1]||
    javax.servlet.ServletException: Index: 0, Size: 0
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:325)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
         at com.legaledcenter.util.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:250)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
         at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
         at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
         at com.jscape.framework.galileo.support.upload.UploadFilter.doFilter(UploadFilter.java:71)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
         at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
         at java.lang.Thread.run(Thread.java:619)
    Caused by: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
         at java.util.ArrayList.RangeCheck(ArrayList.java:547)
         at java.util.ArrayList.get(ArrayList.java:322)
         at javax.faces.component.AttachedObjectListHolder.restoreState(AttachedObjectListHolder.java:161)
         at javax.faces.component.UIComponentBase.restoreState(UIComponentBase.java:1427)
         at com.sun.faces.application.view.StateHolderSaver.restore(StateHolderSaver.java:121)
         at com.sun.faces.application.view.StateManagementStrategyImpl$4.invokeContextCallback(StateManagementStrategyImpl.java:289)
         at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:1253)
         at javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:672)
         at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:1262)
         at javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:672)
         at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:1262)
         at javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:672)
         at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:1262)
         at javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:672)
         at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:1262)
         at javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:672)
         at com.sun.faces.application.view.StateManagementStrategyImpl.restoreView(StateManagementStrategyImpl.java:284)
         at com.sun.faces.application.StateManagerImpl.restoreView(StateManagerImpl.java:177)
         at com.sun.faces.application.view.ViewHandlingStrategy.restoreView(ViewHandlingStrategy.java:119)
         at com.sun.faces.application.view.FaceletViewHandlingStrategy.restoreView(FaceletViewHandlingStrategy.java:434)
         at com.sun.faces.application.view.MultiViewHandler.restoreView(MultiViewHandler.java:143)
         at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:199)
         at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
         at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:110)
         at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:312)
         ... 22 more
    ********** Message End *************Thanks

  • ADF Question: call javascript function from backing bean?

    Hi all,
    I am running JDeveloper 10.1.3.3 with ADF BC.
    Heres my situation:
    I have a table, and after inserting a new row, then committing, I want to call a javascript function. I tried using the onkeyup javascript to force a click of the save button, and then call my function after that. However, I really only want the second function to be called AFTER the commit has occurred.
    I have tried putting a setTimeout on the second function, but this never executes then. Is there some way that I can call the second javascript function from the backing bean? Is there a better workaround for this? Here is some code:
            function submitCreate(e) {
                var _event = (window.event) ? event : e;
                var KeyID = _event.keyCode;
                switch (KeyID)
                    case 13:
                        document.getElementById("form1:tvoTable:commitButton").onclick();
                        doAjax();
                        break;
            function doAjax() {
                var item = document.getElementById("form1:inputText3").innerHTML;
                getAjax(item, "FULL");
            }Thanks,
    Heather

    Maybe try adding an af:script block in your jsp as a partial target in your backing bean when you commit to the database? We are doing something similar when we get a tab DisclosureEvent but the principle should be the same.
    In our jsp we have:
    <af:script id="scriptID" text="alert('javascript here');"/>
    In the backing bean we have:
    method(DisclosureEvent de) {
    // get a component somehow or the component, we get it from the disclosure event
    // but you could use a binding also. if you don't have the exact script element you need
    // to find it like we do below.
    UIComponent c = de.getComponent();
    // Find our real script component
    UIComponent target = c.findComponent(":scriptID");
    // get the adf context
    AdfFacesContext adfContext = AdfFacesContext.getCurrentInstance();
    // add the script as a partial target.
    if(target != null) {
    adfContext.addPartialTarget(target);
    This relies on PPR though, which you may not be doing. If you are navigating to a new page you could set an indication in a backing bean and then access that in an <af:script> block in the new page or even generate the Javascript you want depending on your logic and access all of it via an EL binding on the af:script tag:
    <af:script id="scriptID" text="#{bbean.generatedScript}"/>
    Hope this helps!
    Steve

  • Operation not found error while calling AM methods from managed bean

    Hi,
    operation not found error while calling AM methods from managed bean.
    written a method with two parameters in AM.
    exposed the method in AM client interface
    in the page bindings added the method in method action ..left empty in the value fields of the parameters.
    calling the method from managed bean like below
    String userNameVal = (String)userName.getValue();
    String passwordVal = (String)password.getValue();
    OperationBinding operationBinding =
    ADFUtils.findOperation("verifyLogin");
    operationBinding.getParamsMap().put("userName",userNameVal);
    operationBinding.getParamsMap().put("password",passwordVal);
    operationBinding.execute();
    i am getting operation verifyLogin not found error.Please suggest me something to do.
    Thanks
    Satya

    Hi vlsn,
    Can you try with the below code
    // in your backing bean
    OperationBinding operation = bindings.getOperationBinding("verifyLogin");
    //Put your both parameters here
    operation.getParamsMap().put("parameter_name1", parameterValue1);
    operation.getParamsMap().put("parameter_name2", parameterValue2);
    operation.execute();
    if (operation.getResult() != null) {
    Boolean result = (Boolean) operation.getResult();
    and share the result.
    regards,
    Rajan

  • Call submit button from backing bean

    HI
    I have serverEventHandler method in backing bean. from this method I want to submit a button of jspx(i.e. I want to execute action of that button).
    public void serverEventHandler(ClientEvent clientEvent) {
    }

    Can you add the following code in your code & see if it helps:
    If you have the defined control-flow-case between Page1.jspx to Page2.jspx as "goToPage2",
    you can use the following code snippet in the managed bean in Page1.jspx
    FacesContext context = FacesContext.getCurrentInstance();
    context.getApplication().getNavigationHandler().handleNavigation(context,
    null,
    "goToPage2");Thanks,
    Navaneeth

  • Calling a method in a different backing bean when I leave a different JSP

    Hi,
    I have an existing JPS, JspA, who's backing bean is BeanA.
    JspA has an action, ActionA, called when I click "save" on JspA.
    I want to include a new JspB which is launched when the user clicks "save" on JspA. I have done this with a new navigation rule. The user now does his stuff on the new JspB page and calls "exit" on this page. This calls an action on JspB's backing bean BeanB and navigation rules send the user back to JspA. Problem is I now want the old code in ActionA to execute as if JspB had never existed but not sure how to do this? I don't want the user to have to do anything else to initiate a fresh call to ActionA, I just want it to execute when navigation returns to JspA
    Thanks ...

    Hi,
    what you say is not true. You can execute any code within a selection listener you want. If you can print then it shows the method s called and you can execute whatever you want within this method
    Frank

  • Calling init() method from "session scope" backing beans (AbstractPageBean)

    hi,
    i prepared a jsp/jsf page named DBmanage, its backing bean's scope is set to "session"
    the page contains - among other components - one radiobuttongroup, the buttons of which i would like to rename at the first time when the user visits the page... (default names are "item 1", "item 2", "item 3")
    i thought that the overridden init() method does the work for me with this simple code:
    import com.sun.webui.jsf.model.Option
    @override
    init() {
    rbg_default_options.setOption( new Option[]{new Option("it1", "RB1"), new Option("it2", "RB2")}
    so, let see how this code works when DBmanage backing bean's scope is "request"
    great! i see a radiobuttongroup with two buttons, named RB1 and RB2
    ok, now i change the scope to "session"
    sh&#@t!!! now i'm gazing at a page with buttons named "item 1", "item 2", "item 3"
    let's place a breakpoint inside the init() method and DEBUG... and my init() code has not run(??), how can this happen? init() method is valid only for request beans?
    pls! could anyone help me?
    ps.: i work with netbeans6.0 & glassfish
    thanks
    Gabor

    it's ok. i found out why it wasn't working.
    my scope was set to "session", but had to be "request" so that i could use the params syntax.
    thanks anyway.

  • Calling a method in the backing bean when rendering a table

    I'm rendering a table that begins with :
    <h:dataTable value="#{showRooms.rooms}" var="rowRoom" ...
    There are several properties I'm displaying. Some are just displayed as they appear from the database like:
    <h:outputText value="#{rowRoom.roomNumber}"/>
    However, some I need to translate so they display a more meaningful message to the users. For example, status is stored 'A', or 'NA', but this should display 'Available' or 'Not Available'. To do this, I'm taking an idea I saw in another forum by providing a method to call and translate the text. For example:
    public String getDisplayedStatus(String status) {
    if (status.equals("A") {
    return "Available";
    } else {
    My problem is how can I invoke a method and pass in the current value of status for that row in the table. I think I need something like this:
    <h:outputText value="#{showRooms.getDisplayedStatus(#{rowRoom.roomStatus})"/>
    But that doesn't work. I can invoke the getDisplayedStatus method when passing in a hardcoded parameter, but it won't translate the value of both expressions(the method and the method param). How can I achieve this?
    Thanks,
    Mike

    Yes. I've done that and it does work....sort of. It works as long as I refer to it as 'displayStatus'. It looks up the getDisplayStatus and returns a value. The problem is getting the current status value from the object in the List. For example, the 3rd row in the table has either 'A;' or 'NA' for status. I need to know this value in order to do my translation. The way I see it, I either need
    1.)a way to call a method on the backing bean and pass the value of status from the current row into the method.
    -or-
    2.)in getDisplayStatus, I need a way to access the current row's value, perhaps through an expression. This appears to be what you can do in the AbstractPageBean class that all backing beans inherit in Studio Creator. I've seen code in a getter like 'getValue(#{currentRow.status}'), but I don't know how that is done. I looked for the source to AbstractPageBean on the web but couldn't find it - maybe its not open-source.
    Anyway, please share if anyone has a solution. I'm sure this has been done before.
    Thanks,
    Mike

Maybe you are looking for

  • Flash Player Configuration Failed

    I've been having this problem with Firefox 6.0.2 and Shockwave Flash 10.0.32.18 Every time I tried to download the Flash Player I got a Configuration Failed message. I finally got around after noticing on the Firefox Tools -> Add Ons - > Click to see

  • Execute JSX in Windows?

    execute JSX in Windows? through PHP application

  • LCDS Java Long to Flex Number conversion issue

    Hi, I am having a userVO in Java and Flex. userId attribute of userVO is of type Long in Java class and Number in AS class. The Long attribute userId "10001256" in the Java userVO gets converted to an exponentinal value for e.g 1.0001196E7 by LCDS. I

  • Canon XF105 - Interlaced??? 50fps?

    I borrowed a 3D rig the other day with two Canon XF105s http://www.canon.co.uk/For_Home/Product_Finder/Camcorders/professional/XF105/ What I get off each camera is a bit baffling. In VLC I can see jaggies - it appears to be interlaced! Well, they'd o

  • How can I transfer documents from my macbook to my ipad?

    How do I transfer folders with pdf's and word documents from my macbook to my ipad?