JSF Backing bean / JSP interaction questions

A few questions about JSF beans and JSP page interactions. Bear in mind that I'm new to both JSP and JSF, so a solution that might be obvious to the rest of the world may be new to me.
1. Can I pass a parameter to the backing bean method from an "action" attribute:
<h:commandLink action="#{TableData.SortRec}">
<h:outputText value="#{msgs.selectedHeader}"/>
</h:commandLink>
I'd like to call the same method from several controls, but pass it a parameter to determine which field to sort on.
2) Is there a way for a backing bean method to determine which control invoked it?
3) Is there a way to access JSF backing bean methods from JSP tags. I'd like to do some conditional page assembly based on a JSF bean property... JSF doesn't appear to have a conditional like JSP's <c:if>, but I could use JSP's if it could access the JSF bean.

Could you pl tell me how to pass parameter thru CommandButton
I have the following situation
1) greetingList.faces which list the Ids & greeting Text
Id Text
1 Hello World
2 Hello World
2) Pl note Ids are h:commandLink. A click on the Id will render greetingForm.faces with data pertaining to that Id and with Update h:CommandButton
3) When i click Update button it results in the following error
javax.faces.FacesException: Error calling action method of component with id greetingForm:_id4
Caused by: javax.faces.el.EvaluationException: Exception while invoking expression #{greetingForm.update}
Caused by: java.lang.NullPointerException
So i verified with h:message that Id is passed as Null when click on Update button. I also checked greetingForm.faces has a not null value by printing <h:outputText value="#{greetingForm.message.id}"/>
So i guess the Id value is overwriteen with null. Also i have defined Id as property in managed bean
<managed-bean-name>greetingForm</managed-bean-name>
<managed-bean-class>com.mycompany.GreetingForm</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
<managed-property>
<property-name>id</property-name>
<value>#{param.id}</value>
</managed-property>
Any pointers/suggestions at the earliest on how to pass the value of Id on a click of update button from greetingForm.faces to greetingForm.java will be highly appreciated
I am willing to upload my war file
Regards
Bansi

Similar Messages

  • Open URL in a new browser from a JSF backing bean

    I want to use commandButton action in jsf to launch a new browser instead of using commandLink.
    How do you launch url in a new browser window by firing up a method in backing bean?
    So far I am able to launch a URL within the same browser window. Here is my code:
    In jsp file:
    <h:commandButton rendered="#{openDataList.valueModifiable}" value="link" action="#{openDataList.link}" />
    In backing bean:
    public void link()
         try{
         FacesContext faces = FacesContext.getCurrentInstance();
         faces.responseComplete();
         ExternalContext context = faces.getExternalContext();
         context.redirect("http://www....");      }
         catch(java.io.IOException e)
    ...

    with a commandButton i dont belive you can
    well there are ways you can use javascript window.open
    or you can use a commanLink ans set the target
    but from my understanding there is no way to open a new browser from the backing beans ( this is because this is a client function and your backing beans are on the sever )

  • Calling from an EJB into a JSF Backing Bean

    Hello all,
    I'm looking for some help in making calls from an EJB into a Backing Bean (the converse is fairly straightforward). My basic question is: what is regarded as the best way to do this?
    However, for anybody who's interested, I'll describe what I've been trying...
    Here's my situation (I'm working with OC4J 10.1.3.2). I have a simple application-scoped backing bean:
       public class BackingBean implements SimpleInterface, Serializable {
           private String greeting = "Hello, World";
           private SessionEJBRemote blBeanRemote = null;
           public BackingBean() {
               // get hold of EJB
               // [ ... code to obtain EJB's remote interface snipped ... ]
               // set the callback with the EJB       
               try {
                   blBeanRemote.setCallback(this);
               } catch (Exception ex) {
                   ex.printStackTrace();
           // methods to manipulate the greeting string
           public String getGreeting() {
               return greeting;
           public void setGreeting(String greeting) {
               this.greeting = greeting;
       }SimpleInterface, which my Backing Bean implements is, well, a simple interface:
       public interface SimpleInterface {
           public void setGreeting(String greeting);
       }And my EJB is also pretty straightforward:
       @Stateful(name="SessionEJB")
       public class SessionEJBBean implements SessionEJBRemote, SessionEJBLocal {
           private SimpleInterface callback = null;
           public void setCallback(SimpleInterface callback) {
               this.callback = callback;
               callback.setGreeting("Goodbye, World");
       }Now, by using SimpleInterface, my intention was to ensure a one-way dependency: i.e. the JSF-level code would depend on the EJB-level code, but not vice versa.
    However, my experimentation has shown that when I make the call to blBeanRemote.setCallback, the parameter appears to be passed by value rather than by reference. This means firstly that, at runtime, by EJB needs to have access to my backing bean class and secondly, that the call to callback.setGreeting has no effect.
    Can anybody suggest how to work around this? Is it possible to pass the backing bean by reference? Is there a better way to achieve this callback? I appreciate that these questions might be more general Java/AppServer queries rather than JSF-specific ones - but hopefully this is something that all you JSF experts have encountered before.
    (Incidentally, I realise that what I'm doing in this example is pointless - what I'm building towards is using the ICEFaces framework to have the EJBs prod a backing bean which will in turn cause a user's browser to rerender.)
    Many thanks - any help very much appreciated!
    Alistair.

    Hi Raymond - yes, you've pretty much got that spot on: an event occurs (say receipt of a JMS message - which is spontaneous, as far as the users are concerned). As a result of that event, the client's view (in their browser) needs to be re-rendered.
    ICEFaces uses the AJAX technique to allow server-pushes, and rather than refreshing the whole page it uses "Direct-to-DOM" rendering to maninpulate the page components. If you've not come across it, and you're interested, then there are some pretty interesting demos here: http://www.icefaces.org/main/demos/ - the "chat" feature of the Auction Monitor demo (if you open it up in two browsers) is the nearest to the effect I'm looking for.
    The Auction Monitor demo uses a number of session-scoped beans, each implementing the ICEFaces "Renderable" interface, and each of which registers itself with an application-scoped bean. The application-scoped bean can thus iterate through each of the session-scoped beans and cause the corresponding browser to refresh.
    Unfortunately, in the Auction Monitor demo, the entry point is always from a browser - albeit the result is then mirrored across all connected browsers. I haven't found any examples of this processing being driven by an external event, hence my experimentation in this area!

  • JSF backing bean accessibility from external class

    I am using JSF in my application. Consider i am assigning a value of the inputtext field to a string in my managed bean. This bean has the getters and setters for the string.
    Now my requirement is to get the value of the string i.e. the string value entered in the input text field in another class file. If "A" is a backing bean, I want a class B to access the values(in this case the inputtext value) from A.
    Thanks in Advance.

    Below is the code where i am using the inputtext tag in the JSP page
    <h:inputText value="#{person.name}" />
    "person" is the backing bean which is declared in the faces-config.xml
    PersonBean code:*
    package jsfExample;
    public class PersonBean {
         private String name;
    public void setName(String name) {
              this.name = name;
    public String getName() {
              return this.name;
    Now i have another class in the same package as shown below.
    package jsfExample;
    public class worker extends PersonBean{
    //this function should use the variable name present in the backing bean//
         public void access(){
         PersonBean person= new PersonBean();
         String str=person.getName();
         System.out.println(str);
    //I am getting null value in the str variable inside here//
    but if i print the variable inside the backing bean(*PersonBean*) it is working fine.

  • JSF Backing bean code

    Hi every body ,
    I am creating one form , on that form I have created six tabs.On my entire application I have one backing bean .I have taken that backing bean in a session scope .
    My question :
    Can I create six different backing bean for each tab ?
    A short example :
    //MyBackingBean.java
    //This is the main backing bean.
    class MyBackingBean
            //for first tab
            private FirstTabBackingBean  firstTabBackingBean ;
            //for second tab
            private SecondTabBackingBean  secondTabBackingBean ;
            //for third tab
            private ThirdTabBackingBean  thirdTabBackingBean ;
            //for fourth tab
            private FourthTabBackingBean  fourthTabBackingBean ;
            //for fifth tab
            private FifthTabBackingBean  fifthTabBackingBean ;
            //for sixth tab
            private SixTabBackingBean  sixTabBackingBean ;
            //Simple getter and setter for each backing bean , such as :
           public FirstTabBackingBean getFirstTabBackingBean()
                   if(this.firstTabBackingBean ==null)
                        this.firstTabBackingBean  = new FirstTabBackingBean();
                   return this.firstTabBackingBean;
            public void setFirstTabBackingBean(FirstTabBackingBean firstTabBackingBean )
                  this.firstTabBackingBean  =  firstTabBackingBean ;
            //Same for other remaining 5 beans.
    //FirstTabBackingBean.java
    class FirstTabBackingBean 
          //Here I am doing all actions related to button click & radio button click .........
    }  my faces-config.xml is :
    <managed-bean>
       <managed-bean-name>mainBackingBean</managed-bean-name>
          <managed-bean-class>
              com.myPkg.MyBackingBean
         </managed-bean-class>
       <managed-bean-scope>session</managed-bean-scope>
    </managed-bean>my jsf is somthing like that :
    <h:commandButton  action="#{mainBackingBean.firstTabBackingBean.previousAction }" value="Previous"/>It is working fine for my application.For code maintain purpose I just separate each tabs actions into different beans.
    Is it the proper way ?
    or is there any different way to write code ?
    Thanks,
    SB

    Hi thanks for your suggestion , but the problem is in my app there are more than 60 operations(Actions) are going on , in different tabs , for that reason I just separated all operations & putted in different backing bean .If I use one backing bean it will give a lot of pain to maintain the code , because then only I have to write all action specific codes in that one backing bean .
    Is there any other way out ?
    regards,
    SB

  • JSF Backing Bean State Being Lost Prior to Submit

    ISSUE
    I have an attribute in a backing bean for a drop-down list in a JSF that loses its state before I submit the page, which causes data updates to the backing bean dependent upon its state to be ignored.
    CONTEXT
    The JSF in question has a selectOneMenu drop-down list that determines whether or not several inputText fields will be rendered. The selectOneMenu is bound to an enum in the backing bean, and there are conditional accessors allowing the JSF to determine which inputTexts should be included in the current view. The three valid values of the drop-down are "ALL", "RANGE" and "SINGLE". The page is request scoped, a requirement of this project.
    Here is the JSF tag for the selectOneMenu drop-down list:
    <h:selectOneMenu disabled="#{not backingBean.newEntry}"
        id="tCriteria"
        value="#{backingBean.tCriteria}"
        onchange="submit()">
        <f:selectItems value="#{backingBean.possibleTCriteria}" />
    </h:selectOneMenu>And here are the RANGE selection-specific inputText controls:
    <h:inputText disabled="#{not backingBean.newEntry}"
        rendered="#{backingBean.tRange}"
        id="startTIndex"
        value="#{backingBean.tIndex}" />
    <h:inputText disabled="#{not backingBean.newEntry}"
        rendered="#{backingBean.tRange}"
        id="endTIndex"
        value="#{backingBean.endTIndex}" />Here is how I initialize the backing bean for the drop-down list attribute:
    * The current "t" criteria.
    private TCriteria tCriteria = TCriteria.ALL;And there are basic accessor/mutator methods for it. All of this works pretty well, with one problem. If I select "RANGE" in the drop-down, the appropriate inputText fields appear in the view. When I submit the page with values in the inputText fields, the value of the drop-down in the backing bean has been reset to its default initial value ("ALL") without having been updated through its mutator. Thus, when values in the backing bean are updated from the JSF, the conditional inputText fields are ignored, as they appear to have been deemed irrelevant during the update phase by the invalid state of the backing bean for the drop-down.
    To test my theory, I changed the default value of the backing bean attribute for the drop-down to be "RANGE", and made it final. The page behaves perfectly in updating the backing bean with the values entered for the conditionally-displayed inputText controls. This tells me that the invalid state of the backing bean drop-down list attribute must be the problem. Furthermore, I have tried using "disabled=", "readonly=" and "rendered=" on the conditional inputText fields, and none of that seems to make a difference. I also tried using a ValueChangeHandler, but that didn't do anything about it.
    Note - the backing bean does realize that the correct state for the drop-down should be "RANGE", but only AFTER the backing bean has received its updated values from the page controls.
    Has anyone seen anything like this? I haven't read anything in previous posts about an issue like this, but it has to be something someone has seen before. Maybe related to using the enum type? Thanks.

    Hi,
    did your web.xml file had any parameter regarding explicitly indicating the way to save state?
    I mean something like
    <context-param>
        <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
        <param-value>server</param-value>
      </context-param>One last question: did you stay with request scope beans or session ones?
    Greetings.
    MogaRick

  • Best practice for initializing objects in a JSF backing bean?

    Hi,
    What is the best practice for initializing some objects in the JSF to-page backing bean before the to-page is displayed for the first time? The initialization would vary and depend upon a command link in the from-page.
    Regards,
    Al Malin

    f:view has two new attributes in 1.2: beforePhase and afterPhase
    which allows you to specify a phase listener method
    which will be called before and after the view is processed.

  • WebSphere Custering and JSF Backing Beans

    Hello All,
    Can anyone enlighten me on exactly how backing bean state is maintained by JSF?
    In what scope does JSF store the backing beans? (session perhaps)
    Does it make sense to use JSF without stateful backing beans?
    What would happen if a client post did not find its corresponding backing bean on the application server calling it?
    Background:
    In a clustered WebSphere Server environment, a client post may be directed to any one of the machines in the cluster. If the client post gets directed to a machine other then the machine that originally sent the client a response, the page will not find the corresponding page beans.
    It is possible to serialize session beans in WebSphere and have each machine share its memory with all the boxes in the cluster. However, this practice is not permitted in some environments.
    Any thoughts? Thanks in advance.

    I am probably not an expert on the subject. But here are some thoughts:
    1. A backing bean can have (application, session, request or None) as a scope.
    Less app or session scope beans the better (from server perspective). But
    There are practical reasons why you would want to use them in many cases.
    2. JSF supports Client State Saving mode. But keep in mind the overhead
    Involved (serialization, de-serialization, bandwidth,...).
    3. You probably need to read about WebSphere load balancing capability. From
    what I know it is somehow sophisticated. People typically use session affinity
    to force requests initiated by same session to be served by the same app
    server (enforced by network, hardware/software tools available to do so,...). Of
    course with failover mechanism to ensure high availability.
    Hope that helps!

  • Can I catch the resulting TopLink query in the JSF backing bean?

    Hello!
    I'm using a JSF in my application. In my case, data on the JSF Pages is based on a TopLink queries, which usually have some parameters. Such a construction works fine except one moment.
    For export data purposes, I need to catch the generated text of query evidently, suppose, in a Page's backing bean.
    Is it possible to perform this action and how to?
    Thanks.

    generally speaking, you can just throw one exception a time. you can throw your own application but you can't throw both SQLException and your own.

  • Redirect from JSF backing bean to another application

    Hi,
    I need to open another (non-JSF) application in a new window from the backing bean of my JSF application.
    My JSF application is in frames. - heading, menu, content.
    I've a commandlink in the menu frame.
    I tried with
    FacesContext.getCurrentInstance().getExternalContext().redirect(loginUrl);
    This is opening in the menu frame itself.
    I tried using target="new" , but no result.
    I also need to pass the userId to the external application.
    Any ideas?
    ~Thanks.

    Thanks.
    Yes, GET works. I used a <h:outputLink and used target="new" and
    window.open("url?userId=someId")
    But i donot want to pass userid in GET in the url, since that is a sensitive information.
    Please let me know if there's any other way.
    Thanks,

  • How-to remove a jsf backing bean from session?

    How can I find the reference to a backing bean (with session scope) and then remove the bean?
    I may have painted myself into a corner. When most of my pages are navigated to, they get key info from session and then initially populate the page fields. I populate the fields in the constructor with values from the database based on the keys found in session. So the second time a particular page is called the values may be stale or completely unrelated to the page navigated from because the bean already exists and, naturally, the constructor is never called.
    I'm thinking if I could remove the backing bean, jsf wouldn't find it so it would be recreated on subsequent navigations. Since the constructor would be called with every navigation to the page, the values would not be stale or unrelated.
    Any help would be greatly appreciated.
    TIA,
    Al Malin

    //To reset session bean
    FacesContext
         .getCurrentInstance()
         .getApplication()
         .createValueBinding( "#{yourBeanName}").setValue(FacesContext.getCurrentInstance(), null );
    //To get session bean reference
    Object obj = FacesContext
              .getCurrentInstance()
              .getApplication()
              .createValueBinding("#{yourBeanName}")
              .getValue(FacesContext.getCurrentInstance());
    YourSessionBean bean = (YourSessionBean)obj;

  • How can fill javascript array from list in jsf backing bean

    Hello
    i have an array in javascript and i want to fill in from the list which is coming from the backing bean how can i do that.
    Regards

    Hi,
    using the ExtendedRenderkitService class you can send JavaScript calls from a managed bean to the client. So in your case you call a client side javaScript method and pass the array information as an argument. The way you pass the array data is up to you. You may just pass a character delimited list, or use JSON object notation in case the list shows objects. Note that this is for JDeveloper 11.In 10.1.3 there is no server side JavaScript API. Here you would have to add the JavaScript to the page when rendering it.
    Frank

  • ADF-BC/JSF How to display acustom error message from a backing bean

    Hi all
    Can anybody provide an example of how to manipulate the list of error messages from a JSF backing bean.
    In my code I use a different navigation case and this directs the user to the page displaying the error message but I am sure that there must be a more elegant way.
    Thanks in advance
    Thanassis

    Thanks Kris
    I think you 've put me on the right track here, it's just that in my case what I really want to do is prevent my users from editing records not belonging to their own group. This is done via a selectOne table component and then the backing bean code tests if the value #{row.UserGroup} matches the #{bindings.LoggedOnUserGroup.inputValue}. If the values are equal then the beans returns the navigation case to the edit page. Otherwise it returns the navigation case for the "cannot edit" page.
    So what I am thinking is to return null and somehow raise the right kind of exception in order to display the error in the af:messages tag.
    Thanassis

  • 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

  • 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.

Maybe you are looking for

  • Error message when trying to save/import a CD to my library?

    I was importing a CD into my iTunes library. When almost all the tracks were downloaded, I received an error message. Something about not having enough space in my library or being at a level to allow me to save this. I have about 10 cd's in my libra

  • "itunes has encountered a problem and needs to close" message appears

    Every time I try to open itunes a Windows message comes up saying "itunes has encountered a problem and needs to close." I tried uninstalling and downloading it again, but nothing is working. What do I do??   Windows XP  

  • Labview gpib timeout when calling cvi dll

    Equipment used : VXI Rack with Slot 0 controller Labview V5.0.1 Lab Windows V5.0.1 GPIB controlled Power10 I63 PSU We run an intermediate Labview driver which communicates with a low level CVI driver (dll) to control a PSU.  We recently tried to run

  • HT201413 unknown error (-50) when sync with itunes

    When sync my iphone 5 with itunes i get an unknown error (-50) whats his and how do i fix it?????

  • Adding field to std screen mm01

    Hi folks,   i want to add a feild( idnlf ) to mm01 transaction.iam able to add the feild, bt data is not updating in mara table.iam using enhancement mga00001.in enhancement i wrote code as: Tables: Mara. Data: idnlf type mara-idnlf. if sy-ucomm = 'B