Creation of a Managed Bean in Request Scope?

Is there an easy way to create an instance of a managed bean (configured in faces-config.xml) that was configured to be in the Request scope?
If a JSP refers to it by id, then it will be there.
However, when the JSP does not refer to it, it will not be in the request. I find I need to generate it anyway to use it from within another Managed Bean. I can extract out the faces-config information from the application map (available from FacesContext) and build it manually -- but this ties me to a particular JSF implementation (and probably version, too).
Is there a more standardized way to do this?
Thanks,
ken

BTW -- I mean to do this from within Java code (not jsp), and the page being rendered does not have a direct reference to the request-scoped managed bean via value binding.

Similar Messages

  • Share stateful session bean in JSF managed beans with different scope

    Hi,
    I have a JSF application and I want to try to use of stateful session beans.
    So I created a new stateful session bean and its local interface.
    @Stateful
    public class StatefulSessionBean implements StatefulSessionBeanLocalInterface{
    private String name;
    @Local
    public interface StatefulSessionBeanLocalInterface {
    ...In my JSF application I have a mananed bean with session context which registers the new interface by
    this annotation
    @EJB(name="sessionbeanref", beanInterface=StatefulSessionBeanLocalInterface.class) and set the name to something.
    Now I want to fetch this name in another managed bean with request scope. So I looked up the bean and tried to get the name.
    StatefulSessionBeanLocalInterface = (StatefulSessionBeanLocalInterface) new InitialContext().lookup("java:comp/env/sessionbeanref");
    System.out.println(currentmailingbean.getName());but the name is null.
    Why?

    The xsd was created via the netbeans J2EE enterprise application dialog and I think its the most recent.
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">All other annotations seem to work.
    Wouldnt the lookup completely fail if the deployment process thought that it is version 1.4 ?

  • Communicating between beans in request scope

    I have list.jsp that has a table of items with a link to edit each item like so
    <h:dataTable value="#{list.model}" var="curItem">
        <h:commandLink actionListener="#{item.doActionEdit}" action="edit">
          <h:outputText value="#{curItem.id}"/>
          <f:param name="id" value="#{curItem.id}"/>
        </h:commandLink>
    </h:dataTable>edit is map to item.jsp
    when i click on the link the item bean gets called and doActionEdit sets up the id and fetches data from db but then the bean gets recreated (from scratch and all data is lots id is unset) and it loads item.jsp with and empty bean.
    This only happens when item bean is in request scope, however when it is in session scope it works fine, which brings the question; how can I pass objects to a bean that is in the request scope?
    I have tries to map id of item in faces-config.xml with #{param.id} which works fine if id is passed but fails with a npe when item.jsp loads without id (say I want to create a new item.)
    Please advise me what is the best approach to communicate between beans in request scope, so it will work with and without id being passed.

    here is doActionEdit, basicly it gets the id param and then calls setId which tries to load data from db if id is >0 if that fails or id is <=0 it creates new data object instead.
    when the item bean is in session scope the constructor is called once but if the scope is request it is called twice (first time doActionEdit is called after constructor but the 2nd time only constructor is called and the itemData is empty.
         public void doActionEdit(final ActionEvent event) {
                    int id = 0;
              try {
                   id = Integer.parseInt(FacesUtil.getParameter("id"));
              } catch (Exception e) {
                   e.printStackTrace();
              setId(id);
    private ItemData data = null;
         public void setId(final int id) {
              if (id > 0) {
                   data = DB.getItemData(id); //load data from db
                   if (data == null) {
                        data=new Data();
              else {          
                   data=new Data();
         public Item() {
              data=new Data();
              System.out.println("Loading Item class");
         }

  • Getting bean from request scope

    Hi,
    I am new to JSF and unfortunately I am running into a problem that I am not entirely sure about. I look in other forums and what I am doing looks right but I am not getting the desired result.
    In my faces-config.xml file I have a managed bean defined as follows:
    <managed-bean>
        <managed-bean-name>LogIn</managed-bean-name>
        <managed-bean-class>lex.cac.tables.RefUsers</managed-bean-class>
        <managed-bean-scope>request</managed-bean-scope>
      </managed-bean>I then have a log on page with a form which contains a user name and password field. The tags are defined as
    <h:inputText immediate="false" value="#{LogIn.username}" /> (for username) and
    <h:inputSecret immediate="false" required="true"
                                   value="#{LogIn.password}" /> (for password)
    When I submit the form the web app navigates to a jsp page which attempts to do validation against a database.
    The first step though is retrieving the object which is suppose to be in request scope.
    I attempt the following but I get back null which causes a NullPointerException. Why can't if find the bean?
    ExternalContext ec = FacesContext.getCurrentInstance().getExternalContext();
    Map params         = ec.getRequestParameterMap();
    params.get("LogIn");  //null is returned hereWhat am i doing wrong? Can someone please help.
    Thanks in advance,
    Alex.

    Something like that:
    FacesContext fc = FacesContext.getCurrentInstance();
    RefUsers LogIn = (RefUsers)fc.getApplication().createValueBinding("#{LogIn}").getValue(fc);
    String username = LogIn.getUsername();
    String password = LogIn.getPassword();

  • Have a backing bean in request scope; need to access parameters sent to it

    I have a request scope backing bean in my app, 'projectBean'. This has a property called 'id'.
    /** in request scope in faces-config.xml */
    projectBean {
        id               // set by the param from the previous page
        downloadAction() // activated by commandlink, depends on id
    }There is another backing bean in session scope called 'projectListingBean', which has a dataTable that lists a bunch of projectBeans. In this 'projectListingBean', I can click on any row. That row, when clicked initializes a 'id' parameter, which is then passed to the new 'projectBean'. 'projectBean' then initializes itself based on the id.
    In the jsp page backed by 'projectBean', I also have a link to download something specific to that 'projectBean'. Naturally enough, I have a commandlink with actionBinding to a method in my 'projectBean', downloadXXXAction().
    The problem arises because the downloadXXX() method relies on a 'id'. Remember, this id was orinigally set 2 requests back from the datatable. Since the page backed by 'projectBean' is in request scope, the id is lost, and my method call doesn't work. I tried changing the scope of 'projectBean' to session, but JSF complains that I already setting the 'id' property as a param, I can't set the whole managed bean to something 'higher' like session.
    Of course, the ideal fix to this probelm would be the ability to have beans in page scope, but what other ways (hacks??) are there to get around this?

    Hi, I'm posting some code snippets if it helps with understanding the problem.
    faces-config.xml:
    <!-- PROJECTLISTINGBEAN -->
    <managed-bean>
         <managed-bean-name>projectListingBean</managed-bean-name>
         <managed-bean-scope>session</managed-bean-scope>
         <managed-property>
              <property-name>projectBeans</property-name>
              <property-class>java.util.List</property-class>
              <list-entries>
                   <value-class>
                        com.sun.sleuth.omcmweb.view.bean.ProjectBean
                   </value-class>
              </list-entries>
         </managed-property>
    </managed-bean>
    <!-- PROJECTBEAN -->
    <managed-bean>
         <managed-bean-name>projectBean</managed-bean-name>
         <managed-bean-class>
         </managed-bean-class>
         <managed-bean-scope>request</managed-bean-scope>
         <managed-property>
              <property-name>projectId</property-name>
              <property-class>java.lang.String</property-class>
              <value>#{param.projectId}</value>
         </managed-property>
    </managed-bean>projectlsting.jsp (page backed by projectListingBean)
    <h:dataTable value="#{projectListingBean.projectBeans}"
         var="projectBean" ...>
         <h:column>
              <f:facet name="header">
              </f:facet>
              <h:commandLink action="#{projectListingBean.viewProjectSUmmary}">
                   <h:outputText value="#{projectBean.projectId}" />
                   <f:param name="projectId" value="#{projectBean.projectId}" />
              </h:commandLink>
         </h:column>
    </h:dataTable>projectsummary.jsp (page backed by request scoped projectBean)
    <h:commandLink action="#{projectBean.assessmentAction}" value="..." />
    ...Flow:
    projectlisting.jsp (projectListingBean - session) -param id passed->
    projectsummary.jsp (projectBean - request) -commandLink clicked and id lost-->
    projectSummary.jsp (projectBean - request)

  • Initialize managed bean from request parameters

    Hi:
    I thought this topic would be on the FAQ, but I couldn't find it. I am looking for a mean to initialize my managed bean from the query string. There must be something like:
    <h:form initializeBean=""true"" requestParameter=""id_author"" beanProperty=""#{author.id_author}"" action=""#{author.getFromDB}"" >
    </form>
    The url would be something like http://localhost:8080/protoJSF/showAuthor.jsf?id_author=5334
    And the getFromDB method would be something like
      Public void getFromDB()
         Statement stmt = cn.createStatement( ?SELECT * from author where id_author=? + getId_author() );
         ResultSet rs = stmt.executeQuery();
      }The only way I've found to perform something like this is to present a blank author form with a ''load data'' button: after pressing the button the user can see author's data and edit the data if she wants to. This two-step data screening is annoying, to say the least.
    There must be a better way.
    I beg for a pointer on how can I achieve the initializing of a managed bean with dynamic data.
    Regards
    Alberto Gaona

    You just have to read carefully the very fun 289 pages
    specification :-)Or, if 289 pages of JavaServer Faces is too much, you can get almost all of the same information from the JavaServer Pages 2.0 specification, or even the JSP Standard Tag Libraries specification :-).
    More seriously, the standard set of "magic" variable names that JavaServer Faces recognizes is the same as that reognized by the EL implementations in JSP and JSTL. Specifically:
    * applicationScope - Map of servlet context attributes
    * cooke - Map of cookies in this request
    * facesContext - The FacesContext instance for this request
    * header - Map of HTTP headers (max one value per header name)
    * headerValues - Map of HTTP headers (String array of values per header name)
    * initParam - Map of context initialization parameters for this webapp
    * param - Map of request parameters (max one value per parameter name)
    * paramMap - Map of request parameters (String array of values per parameter name)
    * requestScope - Map of request attributes for this request
    * sessionScope - Map of session attributes for this request
    * view - The UIViewRoot component at the base of the component tree for this view
    If you use a simple name other than the ones on this list, JavaServer Faces will search through request attributes, session attributes, and servlet context (application) attributes. If not found, it will then try to use the managed bean facility to create and configure an appropriate bean, and give it back to you.
    For extra fun, you can even create your own VariableResolver that can define additional "magic" variable names known to your application, and delegate to the standard VariableResolver for anything else.
    Craig McClanahan

  • Reset JSF session and the managed beans with sesison scope

    Hi,
    this is a very general question and maybe stupid for most of you. I have my jsf/facelets web application and i use inside of this application some managed beans, which are session beans. I want to know how is it possible to reset this beans. I'm asking this question beacuse i have this kind of problem: i built my web application which has a login form and i use the browser to test it. When i browse to the login page and I login with my credentials i get my customized home page. Then i open another istance of the browser and i browse to the login page again but this time i login as a different user. The result home page is the same as i got before with my login credentials, so the session is always the same. Instead i want the session and all its objects to be resetted for the new user! Do youn know which is the solution?

    The fact is that i want to have two sessions in parallel, so using the same browser and opening two tabs, i want to browse to the login page and access as two totaly different users and using in parallel the application without the problem of one user's action affecting the other user beacuse of session sharing. So I want to force the application to create two different session for the two users logins, because as i told you before as it is now, they are sharing the same sesison. And i think that if i at the login time I iterate thorugh the session and delete all the objects i will be able to have only one session per time. Isn't it?

  • Avoiding request scope bean clashes for task flow calls

    Hi,
    I have two task flows, Tf1 calls Tf2 using a task flow call activity. The structures of the task flows are as follows:
    Tf1
      Managed Bean: TfBean, request scope
        class Tf1Bean
          has property goTf2Button
      View: View1
        Button bound to #{TfBean.goTf2Button}
          Action -> task flow call to Tf2
    Tf2
      Managed Bean: TfBean, request scope
        class Tf2Bean
          has property testButton
      View: View2
        Button bound to #{TfBean.testButton}
    As you can see both have a request scope bean called TfBean but these are different classes in each. The bean classes have different properties for binding the components on the two pages.
    When I click the button in View1 to navigate I get an error telling me that class Tf1Bean does not have the property testButton. Clearly Tf2Bean is not being instantiated as TfBean already exists for the request.
    I'm guessing this is expected behaviour and it seems logical.
    My question however is what would be good standards or practices to avoid this?
    One way would be a naming convention, however what if I am consuming Tf2 from a library? In this case it would ideally work as a black box and I should not be concerned about it's implementation, specifically names chosen for internal managed beans. Even if it was not a problem initially, the developer of the task flow could add or change the name of a request scope bean introducing a conflict at a later stage.
    Thanks,
    Kevin

    Hi Frank,
    Good to meet you at UKOUG Tech13 yesterday. I changed my test case from request scope to backing bean scope. Unfortunately I still get the same error:
    <RichExceptionHandler> <_logUnhandledException> ADF_FACES-60098:Faces lifecycle receives unhandled exceptions in phase RENDER_RESPONSE 6
    javax.faces.FacesException: javax.el.PropertyNotFoundException: The class 'yyy.view.Tf1Bean' does not have the property 'testButton'.
      at com.sun.faces.application.ApplicationImpl.createComponentApplyAnnotations(ApplicationImpl.java:1900)
      at com.sun.faces.application.ApplicationImpl.createComponent(ApplicationImpl.java:446)
      at javax.faces.webapp.UIComponentELTag.createComponent(UIComponentELTag.java:222)
      at javax.faces.webapp.UIComponentClassicTagBase.createChild(UIComponentClassicTagBase.java:506)
      at javax.faces.webapp.UIComponentClassicTagBase.findComponent(UIComponentClassicTagBase.java:744)
      at javax.faces.webapp.UIComponentClassicTagBase.doStartTag(UIComponentClassicTagBase.java:1311)
      at org.apache.myfaces.trinidad.webapp.UIXComponentELTag.doStartTag(UIXComponentELTag.java:67)
      at oracle.adfinternal.view.faces.unified.taglib.nav.UnifiedCommandButtonTag.doStartTag(UnifiedCommandButtonTag.java:51)
    ...etc.
    What I think is happening, please correct me if I'm wrong...
    Running Tf1, page View1 is displayed.
    Clicking the button on View1 initiates a request and an instance of Tf1Bean is instantiated for the managed bean named TfBean.
    During the request navigation occurs to Tf2 and hence page View2.
    View2 needs a property in TfBean called testButton.
    There is already a managed bean instantiated for this request called TfBean, however this is of class Tf1Bean and does not have the property.
    I have a simple workspace showing this if you want me to send it to you. I am using 11.1.2.4 by the way.
    Thanks,
    Kevin

  • Problems with managed beans on included JSPs

    I've got a problem with managed beans within an included JSP
    The included page looks as follows:
    <f:subview id="includedPage" binding="#{testBean.component}">
         <h:outputText value="Hallo from the included page"/>
         <h:outputText value="#{testBean.msg}" />
    </f:subview>The including page is also very simple
    <f:view>
         <html>
              <head>
                   <title>Test include</title>
              </head>
              <body>
                   <h:outputText value="Hello from the including page"/>               
                   <jsp:include page="included.jsp"/>
              </body>
         </html>
    </f:view>The testBean is a managed bean with page scope and looks as follows:
    public class TestBean {
        public UIComponent fComponent;
        public TestBean() {
            System.out.println("TestBean Constructor called " + toString() );
        public String getMsg() {
            return "Component = " + fComponent ;
        public void setComponent(UIComponent component) {
            System.out.println("setComponent called " + component);       
            fComponent = component;
        public UIComponent getComponent() {
            System.out.println("getComponent called " + fComponent);
            return fComponent;
    }The output to the console is:
    TestBean Constructor called de.kvb.athena.web.beans.TestBean@1bc16f0
    getComponent called null
    TestBean Constructor called de.kvb.athena.web.beans.TestBean@18622f3
    setComponent called javax.faces.component.UINamingContainer@160877b
    TestBean Constructor called de.kvb.athena.web.beans.TestBean@5eb489
    and the page displays
    Hello from the include page
    Hello from the included page Component = null
    Can anyone explain this behavior ? What's the reason that the page displays
    Component = null
    and is it possible to display the parent naming container (subview) this way ?
    how ?
    Thanks

    By "page scope" I assume you mean "none"? If so JSF creates a new bean for each place it's referenced. The closest to the behavior you want, once per "page", is really request scope.
    (I'm not sure why the constructor is being called thrice, though. I should look into this.)
    I assume you want a bean-per-subview scenario. This should be doable, and one way that allows a dynamic number of subviews would be as follows:
    --create a "manager" bean in request scope
    --give it get/set methods that retrieves a Map of "TestBean" instances; the idea is that each subview use a different key "s1", "s2", etc
    back the manager method with Map implementation that checks if there's already a TestBean associated with the key returns it if yes, else null.
    If that seems messy, the component solution is hairy :-) See http://forum.java.sun.com/thread.jspa?threadID=568937&messageID=2812561
    --A                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Managing beans based on URL query parameters

    I was just reading this thread with interest, but it didn't come to the conclusion that I need.
    http://forum.java.sun.com/thread.jsp?forum=427&thread=441432
    In that thread, there were two screens: a table of links to employees and an "edit employee" page. The solution was to use the command_action on the list create an "employee data" bean, which could then be edited on the "edit employee" page.
    My problem is that I need to create some session beans based on query parameters in the URL. Using the example above, I'd have something like: http://localhost/app/editEmployee?empNo=38
    Why? Because the user can bookmark the edit employee page, have two
    browser windows open (which would require two seperate employee data beans), etc... and we need to handle that. It looks like
    that means I can't use the solution in the above thread.
    My current thought is to create a managed-bean with request scope and have it create the EmployeeData bean.
    Another idea is to somehow initialize the bean with managed-properties
    <managed-bean>
        <managed-bean-name>EmpBean</managed-bean-name>
        <managed-bean-class>com.mycompany.EmpBean</managed-bean-class>
        <managed-bean-scope>session</managed-bean-scope>
        <managed-property>
            <property-name>employeeID</property-name>
            <value-ref>queryParamBean</value-ref>
        </managed-property>
    </managed-bean>
    <!--
      just returns FacesContext.getCurrentInstance().getServletRequest().getParameter("id")
    -->
    <managed-bean>
        <managed-bean-name>queryParamBean</managed-bean-name>
        <managed-bean-class>com.mycompany.QueryParamBean</managed-bean-class>
        <managed-bean-scope>none</managed-bean-scope>but that seems kinda hacky. Any other ideas?

    Excellent, using requestScope gets rid of the queryParamBean hack from my first post. For some reason I thought value-ref evaluatations only resolved against stuff the VariableResolver can see. That's not the case. Thanks.
    Unfortunately, this bean really wants to be cached on the session, not the request. I suppose it would be possible to have EmpBean delegate to a bean which is actually cached on the session, but that feels like a hack too (and is a lot of glue code).
    So, I think I'm back to the factory, which can handle creating the bean from the query params, caching it, and putting it on the servlet request. I also got a visit from Captain Obvious and realized that the factory could just be a scriplet.
    <% BeanCreator.createBean("com.company.EmpBean", request.getParameter("id")); %>which also isn't great, but is perhaps easier to understand than the BeanCreator from above. I looked into using EL Functions in the variable resolver for the factory, but it doesn't look like that's possible. It's probably possible to extend VariableResolver to add factory methods for managed-beans, which might be the cleanest solution. I'm thinking something like
    <managed-bean>
      <managed-bean-name>Emp</managed-bean-name>
      <managed-bean-factory>
         <factory-name>com.company.BeanFactory.getBean</factory-name>
         <bean-class>com.company.EmpBean</bean-class>
         <arg-value-ref>sessionScope.id</arg-value-ref>
      </managed-bean-factory>But for now, the current two hacks are:
    #1: to create a URL use plain html <href>.
    #2: use a factory method (varying implementions) to create the bean, cache it, and put it on the servlet request

  • Keeping session using custom save button in managed bean

    Greetings,
    I'm building a application based on BC + ADF(JSF).
    All around the app. I need two buttons, one for committing and actualizing the UI data, and other to return to the previous page.
    Instead of customizing those buttons every time they occurs, I've haded a managed bean to do the work. This managed bean as "request" scope.
    The process of editing a form, requires me to have one form to only view the data and other to edit the data.
    The issue is: when saving a form, it should return ("back" action) to his precedence, keeping the session state.
    That is: If I'm editing "process 2" when i commit it should go to "process 2" in read only mode.
    This works fine if i use "hardcoded buttons", but when i use the managed bean to handle those buttons action, when committing, it goes to the first on the list. It doesen't keep the session state.
    How can i keep the state ?
    Thanks
    here it is the managed bean:
    package fc.view.backing;
    import fc.model.FirstCareAppModuleImpl;
    import javax.faces.context.FacesContext;
    import oracle.adf.model.binding.DCBindingContainer;
    import oracle.adf.view.faces.component.core.nav.CoreCommandButton;
    import oracle.binding.BindingContainer;
    import oracle.binding.OperationBinding;
    import oracle.jbo.ViewObject;
    public class fcLib {
    private BindingContainer bindings;
    private CoreCommandButton commandButton_save;
    private CoreCommandButton commandButton_backOnePage;
    private CoreCommandButton commandButton_backHome;
    * Get and set bindings
    public BindingContainer getBindings() {
    return this.bindings;
    public void setBindings(BindingContainer bindings) {
    this.bindings = bindings;
    * Getters ans setters for "save" and "back" buttons
    public void setCommandButton_save(CoreCommandButton commandButton_save) {
    this.commandButton_save = commandButton_save;
    public CoreCommandButton getCommandButton_save() {
    return commandButton_save;
    public void setCommandButton_backOnePage(CoreCommandButton btn) {
    this.commandButton_backOnePage = btn;
    public CoreCommandButton getCommandButton_backOnePage() {
    return commandButton_backOnePage;
    public void setCommandButton_backHome(CoreCommandButton btn) {
    this.commandButton_backHome = btn;
    public CoreCommandButton getCommandButton_backHome() {
    return commandButton_backHome;
    * Back actions for back buttons
    public String commandButton_backOnePage_action() {
    return "back";
    public String commandButton_backHome_action() {
    return "home";
    * Save button action - Used in al pages that do save (commit) data
    public String commandButton_save_action() {
    BindingContainer bindings = getBindings();
    OperationBinding operationBinding = bindings.getOperationBinding("Commit");
    OperationBinding operationBinding2 = bindings.getOperationBinding("Execute");
    operationBinding.execute();
    operationBinding2.execute();
    // It should be a error page
    if (!operationBinding.getErrors().isEmpty()) {
    return null;
    // Refresh main view object
    DCBindingContainer bc = (DCBindingContainer)FacesContext.getCurrentInstance().getExternalContext().getRequestMap().get("bindings");
    FirstCareAppModuleImpl fc = (FirstCareAppModuleImpl)bc.findDataControl("FirstCareAppModuleDataControl").getDataProvider();
    ViewObject vo_SitSocProf = fc.findViewObject("EpisodiosMain");
    vo_SitSocProf.executeQuery();
    System.out.println(" All done. Ciao ");
    return "back";
    }

    Hi
    I re-execute the query only to refresh the AM VO data.
    I'm using AM EO to access DB Views, that use IOF triggers to update/insert/delete into the DB.
    Using the application, when updating data, changes wont reflect in the UI if I don't refresh the "master" VO, that is "EpisodiosMain". I'm doing a commit and a execute to a "detail" VO.
    "If you need to execute the query and set it back to the last row you worked with, get the row key before executing the query so you can set the current row back to this rowkey"
    Could you please throw a example on how to do this ?
    "Reaching through to the AM to execute the VO isn't best practices. You should grap the associated iterator in teh binding instead and perform the execute operation. Note that usig ADF binding there are only rare situations in which you need to access teh business service directly as you do. "
    Again, could you please post an example of how to do this, or introduce me to some documentation.
    Thanks
    Message was edited by:
    Buondi

  • Problem with Commit button When Backing bean is in Request Scope...

    HI Everybody,
    I have a Backing Bean in request scope having over 1000 lines of code, And in my JSPX page I have a table binding with a view object and At run time when user select the row in table and click the edit button so user will be able to edit that selected row in the same table at run time.. but the problem is : when the user enters some data in the Editable inputTexts and then clicks save(Commit), then the save button doesn't work..but when i delete any selected row and then press save then it is working fine..
    And to test it in Session scope i made another sample page where every thing is working very fine..
    Now i want to know What is the difference between Session scope and request scope bean...
    And is there any solution to Save editable input text in Request scope?.
    Also want to know that is it safe to set the scope of my main bean class to session scope without effecting the current running functionality? which is having over 1000 lines of code and lot of component has been placed...
    Please help me to resolve this problem...
    Thanks in Advance to all of you
    Fizzz..

    Hi Frank...
    In my code i used almost same logic as Andrejus Baranovskis has explained in his Editable Table example...
    You can refer that example to see what problem I'm facing...
    http://andrejusb.blogspot.com/2007/04/create-edit-and-delete-operations-in.html
    The Bean Scope in this Example is Session scope...Save button is working fine...
    But as i Change the bean scope to Request scope then Save button is not working for Edit but it is working for Delete Action very well..
    I want that save button should work also for Edit action in Request Scope..
    Please Make me understand that why it is happened like that..
    and help me to find the solution..
    and Also if you have a better document to Explain the life cycle of Application in Different Bean Scope...So please provide me that Doc to me...
    It would be a great help for me to understand the concept of session...
    Thanks Frank
    Fizzz...

  • How to handle Valuechange events, when page bean is in request scope

    Hello balusc and forum mates,
    I want to know is there any good way to handle ValueChangeEvents events, when the page's bean in request scope.
    My problem is, I have a page having more than 1 value change event so How can I maintain page values at backing bean. My bean is request scope, I can't change to session scope.
    Please I really need it.

    Hi Frank...
    In my code i used almost same logic as Andrejus Baranovskis has explained in his Editable Table example...
    You can refer that example to see what problem I'm facing...
    http://andrejusb.blogspot.com/2007/04/create-edit-and-delete-operations-in.html
    The Bean Scope in this Example is Session scope...Save button is working fine...
    But as i Change the bean scope to Request scope then Save button is not working for Edit but it is working for Delete Action very well..
    I want that save button should work also for Edit action in Request Scope..
    Please Make me understand that why it is happened like that..
    and help me to find the solution..
    and Also if you have a better document to Explain the life cycle of Application in Different Bean Scope...So please provide me that Doc to me...
    It would be a great help for me to understand the concept of session...
    Thanks Frank
    Fizzz...

  • Session scope and request scope

    Hi,
    I've a manage bean in session scope and within this bean I've a reference of another
    object (class person) . My question is, do i have to register this class in my faces-config-xml and if yes which scope should it have? session or request?
    Or it isn't necessary to register it?
    thanks
    class MymanageBean{
    private Person myPerson;
    }

    helllo,
    can someone tell me what the line in the preceding coed means?
    <meta http-equiv="refresh" content="<%= session.getMaxInactiveInterval() %>;url=login.jsp">
    -- session_expiry_test.jsp --
    <%@page contentType="text/html"%>
    <%@page pageEncoding="UTF-8"%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
       "http://www.w3.org/TR/html4/loose.dtd">
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
            <title>JSP Page</title>
            <meta http-equiv="refresh" content="<%= session.getMaxInactiveInterval() %>;url=dummy_login.jsp">
        </head>
        <body>
        <h1>Welcome, dude with a session!</h1>
        Your session will expire in <%= session.getMaxInactiveInterval() %> seconds
        at which time your browser will be redirected to the login page and any
        and all unsaved changes will be lost.
        <br>
        Thank you for your cooperation!
        </body>
    </html>

  • Get Managed bean name while running tests.

    hi,
    while running web application,i can able get managed name.
    but how to get managed bean name while running unit tests.
    thanks
    siva

    public String getManagedBeanName() {
        String managedBeanName = null;
        HttpServletRequest request =
            (HttpServletRequest) FacesContext
                .getCurrentInstance()
                    .getExternalContext()
                        .getRequest();
        // lookup bean in request scope
        Enumeration requestAttributeNames = request.getAttributeNames();
        while (requestAttributeNames.hasMoreElements()) {
            String requestAttribute = (String) requestAttributeNames.nextElement();
            Object object = request.getAttribute(requestAttribute);
            if (object instanceof MyBean) {
                managedBeanName = requestAttribute;
                break;
        if (managedBeanName == null) {
            // lookup bean in session scope
            Enumeration sessionAttributeNames = request.getSession().getAttributeNames();
            while (sessionAttributeNames.hasMoreElements()) {
                String sessionAttribute = (String) sessionAttributeNames.nextElement();
                Object object = request.getSession().getAttribute(sessionAttribute);
                if (object instanceof MyBean) {
                    managedBeanName = sessionAttribute;
                    break;
        return managedBeanName;
    }Sorry, don't know other ways.

Maybe you are looking for

  • Problem with turning off.

    All of a sudden my Ipod won't turn off. I hold down the button like I use to turn it off, but nothing happens. Can anyone help?

  • No login manager + networkManager = no wireless

    Hi, could someone help me out? I'm almost pulling my hair out trying for two days to get the net working. It worked only once then I got back to the same error. It's not a driver fault, it's PAM that isn't playing nice to me, or me with him I guess I

  • Reservation of iPhone 5

    Why hasn't iphone 5 reservation started? It says that we can reserve iphone 5 between 7am to 3pm. It is 7:22an now!!!! The reservation has not opened yet!!!!!!!!! I have been waiting it for so long.......................

  • Help on FILE to File Scenario

    Hi all,    I am trying to create a simple a XML File TO XML File scenario. Somehow the server is picking up the input file properly but it is not putting the output file properly. When I go to RunTime WorkBench and click on Message Monitoring It show

  • SYNCing or copying everything on iphone to itunes

    syncing or copying everything on iphone to itunes?