3 Replies Latest reply on May 1, 2009 12:12 AM by nohacks

    I changed the bean to request and now have this issue.

      I changed the bean to request from session bean and now have an issue.

      <rich:dataGrid id="membersInZipcode" value="#{membersInZipcode.arrayListOfSearch4Member}"
       var="membersInZipcode" columns="5" elements="20">
       <f:facet name="footer">
       <rich:datascroller></rich:datascroller>
       </f:facet>
      
       </rich:dataGrid>
       </h:form>
      


      I am using a request bean to hold the search parms that loads the bean. This works great.

      The problem is when I use the rich:datascroller for the next page.
      It goes back to the bean and the request scope bean is empty. This holds the search values.

      How do I put this back into the request after each process??

      Can this work with a request bean instead of session bean? I had a session bean but this was bad. When the user tried another search the bean had preselected values from last search in session bean. I was removing the session bean and putting it back into session like this...

      <%
      FacesContext.getCurrentInstance().getExternalContext().getSessionMap().remove("SearchFormBean");
      FacesContext.getCurrentInstance().getExternalContext().getSessionMap().put("SearchFormBean", new SearchFormBean());
      %>
      


      That did not work all the time either.

      Any help out there????

      Thanks
      Phil



        • 1. Re:  I changed the bean to request and now have this issue.
          nbelaevski

          Hello Phil,

          You can try using a4j:keepAlive component.

          • 2. Re:  I changed the bean to request and now have this issue.

            Thanks for the quick reply.

            I put this in my jsf page.

             <h:messages layout="table" showDetail="true" style="color: red" />
            
             <a4j:keepAlive beanName = "#{SearchFormBean}"/>
            
             <h:form id="f1" >
            


            package com.myApp.java;
            
            import java.io.Serializable;
            
            public class SearchFormBean extends Object implements Serializable{
             private static final long serialVersionUID = 7287950280019980982L;
            
            
             private boolean freeMembers = true;
             private boolean verifiedMembers = true;
            
             private String memberHeightFeet = "5";
             private String memberHeightInch = "0";
            


            I get this error..




            SEVERE: Servlet.service() for servlet jsp threw exception
            org.apache.jasper.JasperException: /searchMemberZip.jsp(35,0) According to TLD or attribute directive in tag file,
            attribute beanName does not accept any expressions
             at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40)
             at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407)
             at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:148)
             at org.apache.jasper.compiler.Validator$ValidateVisitor.checkXmlAttributes(Validator.java:1174)
             at org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:821)
             at org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1512)
             at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2343)
             at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2393)
             at org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:840)
             at org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1512)
             at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2343)
             at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2393)
            
            
            
            SEVERE: JSF1054: (Phase ID: RENDER_RESPONSE 6, View ID: /searchMemberZip.jsp) Exception thrown during phase execution: javax.faces.event.PhaseEvent[source=com.sun.faces.lifecycle.LifecycleImpl@13e3940]
            2009-04-30 23:10:07,706 ERROR org.ajax4jsf.webapp.BaseXMLFilter org.ajax4jsf.webapp.BaseXMLFilter doXmlFilter - Exception in the filter chain
            org.apache.jasper.JasperException: /searchMemberZip.jsp(35,0) According to TLD or attribute directive in tag file, attribute beanName does not accept any expressions
             at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40)
             at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407)
             at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:148)
             at org.apache.jasper.compiler.Validator$ValidateVisitor.checkXmlAttributes(Validator.java:1174)
             at org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:821)
             at org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1512)
             at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2343)
            
            
            Apr 30, 2009 11:10:07 PM org.apache.catalina.core.StandardWrapperValve invoke
            SEVERE: Servlet.service() for servlet Faces Servlet threw exception
            org.apache.jasper.JasperException: /searchMemberZip.jsp(35,0) According to TLD or attribute directive in tag file, attribute beanName does not accept any expressions
             at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40)
             at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407)
             at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:148)
             at org.apache.jasper.compiler.Validator$ValidateVisitor.checkXmlAttributes(Validator.java:1174)
             at org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:821)
             at org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1512)
             at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2343)
             at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2393)
             at org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:840)
             at org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1512)
             at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2343)


            • 3. Re:  I changed the bean to request and now have this issue.

              Works Great !!!!

              Thanks a ton guys....

              I changed.

              <a4j:keepAlive beanName = "#{SearchFormBean}"/>

              To this..

              <a4j:keepAlive beanName = "SearchFormBean"/>


              Thanks again this will help keep memory requirements down with less session beans. Also it works correctly..!!

              Thanks

              Phil