4 Replies Latest reply on Nov 15, 2006 1:17 PM by Gavin King

    more seam resolver issues - how to handle a list that isn't

    Arnie Morein Novice

      I am trying to build a simple, two page app that performs a login and if valid, proceeds to the second form that has search fields across the top and displays any valid records below the form (if any).

      The login works fine and forwards to the 2nd page. I would expect seam not to find anything in the "conversation" (rather than sesssion) since the user hasn't entered anything. But when I do type in something and press Search, I get:

      2006-11-15 10:53:25,546 DEBUG [org.jboss.seam.contexts.Lifecycle] >>> Begin web request
      2006-11-15 10:53:25,578 DEBUG [org.jboss.seam.Component] instantiating Seam component: org.jboss.seam.core.manager
      2006-11-15 10:53:25,578 DEBUG [org.jboss.seam.core.Manager] No stored conversation
      2006-11-15 10:53:25,578 DEBUG [org.jboss.seam.contexts.Contexts] found in application context: org.jboss.seam.core.init
      2006-11-15 10:53:25,578 DEBUG [org.jboss.seam.jsf.AbstractSeamPhaseListener] After restoring conversation context: ConversationContext(3)
      2006-11-15 10:53:25,578 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] resolving name: dpsDriversList
      2006-11-15 10:53:25,578 DEBUG [org.jboss.seam.Component] instantiating Seam component: dpsDriversList
      2006-11-15 10:53:25,578 DEBUG [org.jboss.seam.util.Naming] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}
      2006-11-15 10:53:25,578 DEBUG [org.hibernate.impl.SessionImpl] opened session at timestamp: 4766144944447488
      2006-11-15 10:53:25,578 DEBUG [org.hibernate.jdbc.JDBCContext] TransactionFactory reported no active transaction; Synchronization not registered
      2006-11-15 10:53:25,578 DEBUG [org.hibernate.ejb.AbstractEntityManagerImpl] Looking for a JTA transaction to join
      2006-11-15 10:53:25,578 DEBUG [org.hibernate.jdbc.JDBCContext] successfully registered Synchronization
      2006-11-15 10:53:25,593 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] resolved name to seam component
      2006-11-15 10:53:25,593 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] resolving name: dpsDriversFound
      2006-11-15 10:53:25,593 DEBUG [org.jboss.seam.Component] seam component not found: dpsDriversFound
      2006-11-15 10:53:25,593 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] could not resolve name
      2006-11-15 10:53:25,593 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] resolving name: dpsDriversList
      2006-11-15 10:53:25,593 DEBUG [org.jboss.seam.contexts.Contexts] found in conversation context: dpsDriversList
      2006-11-15 10:53:25,593 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] resolved name to seam component
      2006-11-15 10:53:25,593 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] resolving name: dpsDriversFound
      2006-11-15 10:53:25,593 DEBUG [org.jboss.seam.Component] seam component not found: dpsDriversFound
      2006-11-15 10:53:25,593 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] could not resolve name
      2006-11-15 10:53:25,593 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] resolving name: dpsDriversList
      2006-11-15 10:53:25,593 DEBUG [org.jboss.seam.contexts.Contexts] found in conversation context: dpsDriversList
      2006-11-15 10:53:25,593 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] resolved name to seam component
      2006-11-15 10:53:25,593 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] resolving name: dpsDriverCriteria
      2006-11-15 10:53:25,593 DEBUG [org.jboss.seam.Component] seam component not found: dpsDriverCriteria
      2006-11-15 10:53:25,593 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] could not resolve name
      2006-11-15 10:53:25,656 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] resolving name: dpsDriversList
      2006-11-15 10:53:25,656 DEBUG [org.jboss.seam.contexts.Contexts] found in conversation context: dpsDriversList
      2006-11-15 10:53:25,656 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] resolved name to seam component
      2006-11-15 10:53:25,656 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] resolving name: dpsDriverCriteria
      2006-11-15 10:53:25,656 DEBUG [org.jboss.seam.Component] seam component not found: dpsDriverCriteria
      2006-11-15 10:53:25,656 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] could not resolve name
      2006-11-15 10:53:25,656 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] resolving name: dpsDriversList
      2006-11-15 10:53:25,656 DEBUG [org.jboss.seam.contexts.Contexts] found in conversation context: dpsDriversList
      2006-11-15 10:53:25,656 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] resolved name to seam component
      2006-11-15 10:53:25,656 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] resolving name: dpsDriverCriteria
      2006-11-15 10:53:25,656 DEBUG [org.jboss.seam.Component] seam component not found: dpsDriverCriteria
      2006-11-15 10:53:25,656 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] could not resolve name
      2006-11-15 10:53:25,671 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] resolving name: dpsDriversList
      2006-11-15 10:53:25,671 DEBUG [org.jboss.seam.contexts.Contexts] found in conversation context: dpsDriversList
      2006-11-15 10:53:25,671 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] resolved name to seam component
      2006-11-15 10:53:25,671 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] resolving name: dpsDriverCriteria
      2006-11-15 10:53:25,671 DEBUG [org.jboss.seam.Component] seam component not found: dpsDriverCriteria
      2006-11-15 10:53:25,671 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] could not resolve name
      2006-11-15 10:53:25,671 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] resolving name: dpsDriversList
      2006-11-15 10:53:25,671 DEBUG [org.jboss.seam.contexts.Contexts] found in conversation context: dpsDriversList
      2006-11-15 10:53:25,671 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] resolved name to seam component
      2006-11-15 10:53:25,671 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] resolving name: dpsDriverCriteria
      2006-11-15 10:53:25,671 DEBUG [org.jboss.seam.Component] seam component not found: dpsDriverCriteria
      2006-11-15 10:53:25,671 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] could not resolve name
      2006-11-15 10:53:25,671 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] resolving name: dpsDriversList
      2006-11-15 10:53:25,671 DEBUG [org.jboss.seam.contexts.Contexts] found in conversation context: dpsDriversList
      2006-11-15 10:53:25,671 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] resolved name to seam component
      2006-11-15 10:53:25,671 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] resolving name: dpsDriversFound
      2006-11-15 10:53:25,671 DEBUG [org.jboss.seam.Component] seam component not found: dpsDriversFound
      2006-11-15 10:53:25,671 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] could not resolve name
      2006-11-15 10:53:25,671 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] resolving name: dpsDriversList
      2006-11-15 10:53:25,671 DEBUG [org.jboss.seam.contexts.Contexts] found in conversation context: dpsDriversList
      2006-11-15 10:53:25,671 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] resolved name to seam component
      2006-11-15 10:53:25,671 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] resolving name: dpsDriversFound
      2006-11-15 10:53:25,671 DEBUG [org.jboss.seam.Component] seam component not found: dpsDriversFound
      2006-11-15 10:53:25,671 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] could not resolve name
      2006-11-15 10:53:25,671 DEBUG [org.jboss.seam.util.Naming] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}
      2006-11-15 10:53:25,671 DEBUG [org.jboss.seam.jsf.SeamExtendedManagedPersistencePhaseListener] committing transaction after phase: PROCESS_VALIDATIONS(3)
      2006-11-15 10:53:25,671 DEBUG [org.jboss.seam.util.Naming] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}
      2006-11-15 10:53:25,671 DEBUG [org.hibernate.jdbc.JDBCContext] TransactionFactory reported no active transaction; Synchronization not registered
      2006-11-15 10:53:25,671 DEBUG [org.jboss.seam.util.Naming] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}
      2006-11-15 10:53:25,671 DEBUG [org.jboss.seam.jsf.SeamExtendedManagedPersistencePhaseListener] beginning transaction prior to phase: RENDER_RESPONSE(6)
      2006-11-15 10:53:25,671 DEBUG [org.jboss.seam.util.Naming] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}
      2006-11-15 10:53:25,671 DEBUG [org.jboss.seam.Component] instantiating Seam component: facesMessages
      2006-11-15 10:53:25,687 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] resolving name: dpsDriversList
      2006-11-15 10:53:25,687 DEBUG [org.jboss.seam.contexts.Contexts] found in conversation context: dpsDriversList
      2006-11-15 10:53:25,687 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] resolved name to seam component
      2006-11-15 10:53:25,687 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] resolving name: dpsDriversFound
      2006-11-15 10:53:25,687 DEBUG [org.jboss.seam.Component] seam component not found: dpsDriversFound
      2006-11-15 10:53:25,687 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] could not resolve name
      2006-11-15 10:53:25,687 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] resolving name: dpsDriversList
      2006-11-15 10:53:25,687 DEBUG [org.jboss.seam.contexts.Contexts] found in conversation context: dpsDriversList
      2006-11-15 10:53:25,687 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] resolved name to seam component
      2006-11-15 10:53:25,687 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] resolving name: dpsDriversFound
      2006-11-15 10:53:25,687 DEBUG [org.jboss.seam.Component] seam component not found: dpsDriversFound
      2006-11-15 10:53:25,687 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] could not resolve name
      2006-11-15 10:53:25,687 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] resolving name: dpsDriversList
      2006-11-15 10:53:25,687 DEBUG [org.jboss.seam.contexts.Contexts] found in conversation context: dpsDriversList
      2006-11-15 10:53:25,687 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] resolved name to seam component
      2006-11-15 10:53:25,687 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] resolving name: dpsDriversFound
      2006-11-15 10:53:25,687 DEBUG [org.jboss.seam.Component] seam component not found: dpsDriversFound
      2006-11-15 10:53:25,687 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] could not resolve name
      2006-11-15 10:53:25,687 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] resolving name: dpsDriversList
      2006-11-15 10:53:25,687 DEBUG [org.jboss.seam.contexts.Contexts] found in conversation context: dpsDriversList
      2006-11-15 10:53:25,687 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] resolved name to seam component
      2006-11-15 10:53:25,687 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] resolving name: dpsDriversFound
      2006-11-15 10:53:25,687 DEBUG [org.jboss.seam.Component] seam component not found: dpsDriversFound
      2006-11-15 10:53:25,687 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] could not resolve name
      2006-11-15 10:53:25,687 DEBUG [org.jboss.seam.core.Manager] Discarding conversation state: 3
      2006-11-15 10:53:25,687 DEBUG [org.jboss.seam.contexts.Lifecycle] flushing page context
      2006-11-15 10:53:25,718 DEBUG [org.jboss.seam.util.Naming] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}
      2006-11-15 10:53:25,718 DEBUG [org.jboss.seam.jsf.SeamExtendedManagedPersistencePhaseListener] committing transaction after phase: RENDER_RESPONSE(6)
      2006-11-15 10:53:25,718 DEBUG [org.jboss.seam.util.Naming] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}
      2006-11-15 10:53:25,718 DEBUG [org.jboss.seam.contexts.Lifecycle] After render response, destroying contexts
      2006-11-15 10:53:25,718 DEBUG [org.jboss.seam.contexts.Lifecycle] destroying event context
      2006-11-15 10:53:25,718 DEBUG [org.jboss.seam.contexts.Contexts] destroying: org.jboss.seam.core.manager
      2006-11-15 10:53:25,718 DEBUG [org.jboss.seam.contexts.Contexts] destroying: org.apache.myfaces.application.jsp.JspStateManagerImpl.SERIALIZED_VIEW
      2006-11-15 10:53:25,718 DEBUG [org.jboss.seam.contexts.Contexts] destroying: com.sun.facelets.legacy.ELCONTEXT
      2006-11-15 10:53:25,718 DEBUG [org.jboss.seam.contexts.Lifecycle] destroying conversation context
      2006-11-15 10:53:25,718 DEBUG [org.jboss.seam.contexts.Contexts] destroying: facesMessages
      2006-11-15 10:53:25,718 DEBUG [org.jboss.seam.contexts.Contexts] destroying: dpsDriversList
      2006-11-15 10:53:25,718 DEBUG [org.jboss.ejb3.entity.ExtendedPersistenceContextPropagationInterceptor] ++++ LongLivedSessionPropagationInterceptor
      2006-11-15 10:53:25,718 DEBUG [org.hibernate.jdbc.JDBCContext] TransactionFactory reported no active transaction; Synchronization not registered
      2006-11-15 10:53:25,718 DEBUG [org.hibernate.ejb.AbstractEntityManagerImpl] Looking for a JTA transaction to join
      2006-11-15 10:53:25,718 DEBUG [org.hibernate.jdbc.JDBCContext] successfully registered Synchronization
      2006-11-15 10:53:25,718 DEBUG [org.hibernate.jdbc.JDBCContext] TransactionFactory reported no active transaction; Synchronization not registered
      2006-11-15 10:53:25,718 DEBUG [org.hibernate.jdbc.JDBCContext] TransactionFactory reported no active transaction; Synchronization not registered
      2006-11-15 10:53:25,718 DEBUG [org.jboss.seam.contexts.Lifecycle] flushing server-side conversation context
      2006-11-15 10:53:25,718 DEBUG [org.jboss.seam.contexts.Lifecycle] <<< End web request
      


      I've got the seam.properties file in the root of the EJB archive. This is working since the user login page was able to resolve the class to authenticate the user against.

      Here's my quandry:

      The concept of a DpsDriver (class) is an Entity since they exist in a table. That same object should store the users search parameters (private DpsDriver dpsDriverCriteria;) and of course a List of them is what should be returned from the database. I have no way of knowing if the following class and page would even work since seam cannot find the classes.

      According to the tutorial on pages 13 and 14, the form references the @DataModel and @DataModelSelection properties and NOT the encompassing class:

      this:
      <td class="formFieldColumn"><h:inputText id="driverName" value="#{dpsDriverCriteria.DriverName}"/></td>
      
      not this:
      <td class="formFieldColumn"><h:inputText id="driverName" value="#{dpsDriversList[dpsDriverCriteria].DriverName}"/></td>
      
      


      I'm sure I have some aspect of the syntax wrong up there. But I've tried every variation I could think of.

      Seam is complaining that it cannot find an object - when the name its looking for is property of an object. What have I setup wrong?!

      class:
      
      package us.tx.state.oag.DPSLicenseInquiry.business;
      
      import java.io.Serializable;
      import java.util.List;
      
      import javax.ejb.Remove;
      import javax.ejb.Stateful;
      import javax.persistence.EntityResult;
      import javax.persistence.EntityManager;
      import javax.persistence.EntityManagerFactory;
      import javax.persistence.Persistence;
      import javax.persistence.PersistenceContext;
      import javax.persistence.PersistenceContextType;
      import javax.persistence.PersistenceUnit;
      import javax.persistence.Query;
      
      import org.jboss.seam.ScopeType;
      import org.jboss.seam.annotations.Conversational;
      import org.jboss.seam.annotations.Destroy;
      import org.jboss.seam.annotations.Factory;
      import org.jboss.seam.annotations.In;
      import org.jboss.seam.annotations.Name;
      import org.jboss.seam.annotations.Out;
      import org.jboss.seam.annotations.Scope;
      import org.jboss.seam.annotations.datamodel.DataModel;
      import org.jboss.seam.annotations.datamodel.DataModelSelection;
      
      import us.tx.state.oag.DPSLicenseInquiry.business.DpsDriver;
      import us.tx.state.oag.DPSLicenseInquiry.business.DpsDriversList;
      import us.tx.state.oag.DPSLicenseInquiry.business.User;
      
      @Stateful
      @Name("dpsDriversList")
      @Scope(ScopeType.CONVERSATION)
      @Conversational(ifNotBegunOutcome="userLogin")
      public class DpsDriversListAction implements DpsDriversList, Serializable {
      
       @In(create=false, required=true)
       private User user;
      
       @DataModel
       private List<DpsDriver> dpsDriversFound;
      
       @DataModelSelection
       private DpsDriver currentDpsDriver;
      
       public DpsDriver getCurrentDpsDriver() {
       return currentDpsDriver;
       }
      
       @In(create=true)
       @Out(scope=ScopeType.CONVERSATION,required=false)
       private DpsDriver dpsDriverCriteria;
      
       @In
       @PersistenceContext(type=PersistenceContextType.EXTENDED)
       @PersistenceUnit(unitName="PuDpsLicenseInquiry")
       private EntityManager DpsLicenseDb;
      
       public DpsDriversListAction() {
       // constructor
       }
      
       @Remove @Destroy
       public void destroy() {}
      
       //@Factory("dpsDriversList")
       public String findDpsDrivers() {
       try {
       Query q = DpsLicenseDb.createNamedQuery("txdlinquiry_spr");
       q.setParameter("@pDtDOB", dpsDriverCriteria.getDriverDob());
       q.setParameter("@pTxtAddress", dpsDriverCriteria.getDriverAddress());
       q.setParameter("@pTxtCityName", dpsDriverCriteria.getDriverCity());
       q.setParameter("@pTxtDLnumber", dpsDriverCriteria.getLicenseNumber());
       q.setParameter("@pTxtName", dpsDriverCriteria.getDriverName());
       dpsDriversFound = q.getResultList();
       return "success";
       } catch (Exception e) {
       return "failure";
       }
       }
      
      }
      


      Form:
      
      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
       "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      <html xmlns="http://www.w3.org/1999/xhtml"
       xmlns:s="http://jboss.com/products/seam/taglib"
       xmlns:ui="http://java.sun.com/jsf/facelets"
       xmlns:f="http://java.sun.com/jsf"
       xmlns:h="http://java.sun.com/jsf/html">
      <head>
       <f:loadBundle basename="messages" var="msgs" />
       <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
       <title>OAG / DPS License Inquiry</title>
       <link href="stylesheet/theme.css" rel="stylesheet" type="text/css" />
      </head>
      <body>
      <div id="pgHeader">
       <img src="images/banner.jpg" alt="OAG Banner" width="800px"/>
      </div>
      <div id="pgHeaderText">Office of the Attorney General</div>
      
      <div class="pgHorizSpace"> </div>
      
      <div id="pgMessages">
       <h:messages globalOnly="true"/>
      </div>
      
      <div class="pgHorizSpace"> </div>
      
      <div id="pgContent">
      <h:form>
       <fieldset>
       <legend>Enter your Search Criteria</legend>
       <table class="formInput">
       <tr><td> </td></tr>
       <tr><td colspan="6">NOTE: License number searches are exclusive, other fields may be used interchangebly.</td></tr>
       <tr><td class="formColumnRight">DL#</td>
       <td class="formColumnRight">Last, First Name</td>
       <td class="formColumnRight">Address</td>
       <td class="formColumnRight">City</td>
       <td class="formColumnRight">DOB</td>
       </tr>
       <tr><td> </td></tr>
      
       <tr><td class="formFieldColumn"><h:inputText id="driverLicenseNumber" value="#{dpsDriversList[dpsDriverCriteria].LicenseNumber}"/></td>
       <td class="formFieldColumn"><h:inputText id="driverName" value="#{dpsDriversList[dpsDriverCriteria].DriverName}"/></td>
       <td class="formFieldColumn"><h:inputText id="driverAddress" value="#{dpsDriversList[dpsDriverCriteria].DriverAddress}"/></td>
       <td class="formFieldColumn"><h:inputText id="driverCity" value="#{dpsDriversList[dpsDriverCriteria].DriverCity}"/></td>
       <td class="formFieldColumn"><h:inputText id="driverDob" value="#{dpsDriversList[dpsDriverCriteria].DriverDob}"/></td>
       </tr>
      
       <tr><td class="formFieldColumn"><h:commandButton styleClass="formButton" action="#{dpsDriversList.findDpsDrivers}" value="Search"/></td>
       </tr>
       </table>
       </fieldset>
      </h:form>
       <h:outputText value="No records to display" rendered="#{empty dpsDriversList[dpsDriversFound]}"/>
       <h:dataTable var="aDriver" value="#{dpsDriversList[currentDpsDriver]}" rendered="#{not empty dpsDriversList[dpsDriversFound]}">
       <h:column>
       <f:facet name="header">
       <h:outputText value="DL Number"/>
       </f:facet>
       <h:outputText value="#{aDriver.LicenseNumber}"/>
       </h:column>
       <h:column>
       <f:facet name="header">
       <h:outputText value="Name"/>
       </f:facet>
       <h:outputText value="#{aDriver.DriverName}"/>
       </h:column>
       <h:column>
       <f:facet name="header">
       <h:outputText value="Address"/>
       </f:facet>
       <h:outputText value="#{aDriver.DriverAddress}"/>
       </h:column>
       <h:column>
       <f:facet name="header">
       <h:outputText value="City"/>
       </f:facet>
       <h:outputText value="#{aDriver.DriverCity}"/>
       </h:column>
       <h:column>
       <f:facet name="header">
       <h:outputText value="DOB"/>
       </f:facet>
       <h:outputText value="#{aDriver.DriverDob}"/>
       </h:column>
       </h:dataTable>
      </div>
      <div class="pgHorizSpace"> </div>
      <div id="pgFooter">
       <p>(no footer text)</p>
       <p class="copyright">© 2006 Office of the Attorney General</p>
      </div>
      </body>
      </html>
      


      Please help! I've wasted nearly two weeks trying to get this to work.

        • 1. Re: more seam resolver issues - how to handle a list that is
          Gavin King Master

          You wasted two weeks, and you didn't even bother to look at the examples???!!

          You have multiple trivial errors here, all of which would be obvious if you looked at examples:

          <h:dataTable var="aDriver" value="#{dpsDriversList[currentDpsDriver]}" rendered="#{not empty dpsDriversList[dpsDriversFound]}">


          Should be:

          <h:dataTable var="aDriver" value="#{dpsDriversFound}" rendered="#{not empty dpsDriversFound}">


          And

          <td class="formFieldColumn"><h:inputText id="driverName" value="#{dpsDriversList[dpsDriverCriteria].DriverName}"/></td>


          should be:

          <td class="formFieldColumn"><h:inputText id="driverName" value="#{dpsDriverCriteria.driverName}"/></td>


          And

          <h:outputText value="#{aDriver.DriverName}"/>


          should be:

          <h:outputText value="#{aDriver.driverName}"/>


          And

          q.setParameter("@pDtDOB", dpsDriverCriteria.getDriverDob());


          should not have an @ in it.


          I recommend actually trying to learn JSF and Seam before typing random things into your editor. Geez!!

          • 2. Re: more seam resolver issues - how to handle a list that is
            Gavin King Master

            Note that you will also need an @Factory method or something on DpsDriversListAction, since currently there is absolutely nothing that calls DpsDriversListAction.

            • 3. Re: more seam resolver issues - how to handle a list that is
              Arnie Morein Novice

              Granted, I'm inexperienced with JSF. But in all fairness, I created this application following the examples and using the seam-gen program. I was able to alter the first form and got it to work.

              I've been looking through the example programs as well, including the DvdStore project and it doesn't exactly correlate to the book due to its complexity.

              I did as suggested and I still get the same error. I finds the dpsDriversList component but thinks the dpsDriversFound property is a component.

              2006-11-15 11:41:24,578 DEBUG [org.jboss.seam.contexts.Lifecycle] >>> Begin web request
              2006-11-15 11:41:24,609 DEBUG [org.jboss.seam.Component] instantiating Seam component: org.jboss.seam.core.manager
              2006-11-15 11:41:24,609 DEBUG [org.jboss.seam.core.Manager] No stored conversation
              2006-11-15 11:41:24,609 DEBUG [org.jboss.seam.contexts.Contexts] found in application context: org.jboss.seam.core.init
              2006-11-15 11:41:24,609 DEBUG [org.jboss.seam.jsf.AbstractSeamPhaseListener] After restoring conversation context: ConversationContext(3)
              2006-11-15 11:41:24,609 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] resolving name: dpsDriversFound
              2006-11-15 11:41:24,609 DEBUG [org.jboss.seam.Component] seam component not found: dpsDriversFound
              2006-11-15 11:41:24,609 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] could not resolve name
              2006-11-15 11:41:24,609 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] resolving name: dpsDriversFound
              2006-11-15 11:41:24,609 DEBUG [org.jboss.seam.Component] seam component not found: dpsDriversFound
              2006-11-15 11:41:24,609 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] could not resolve name
              2006-11-15 11:41:24,609 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] resolving name: dpsDriverCriteria
              2006-11-15 11:41:24,609 DEBUG [org.jboss.seam.Component] seam component not found: dpsDriverCriteria
              2006-11-15 11:41:24,609 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] could not resolve name
              2006-11-15 11:41:24,687 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] resolving name: dpsDriverCriteria
              2006-11-15 11:41:24,687 DEBUG [org.jboss.seam.Component] seam component not found: dpsDriverCriteria
              2006-11-15 11:41:24,687 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] could not resolve name
              2006-11-15 11:41:24,687 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] resolving name: dpsDriverCriteria
              2006-11-15 11:41:24,687 DEBUG [org.jboss.seam.Component] seam component not found: dpsDriverCriteria
              2006-11-15 11:41:24,687 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] could not resolve name
              2006-11-15 11:41:24,687 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] resolving name: dpsDriverCriteria
              2006-11-15 11:41:24,687 DEBUG [org.jboss.seam.Component] seam component not found: dpsDriverCriteria
              2006-11-15 11:41:24,687 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] could not resolve name
              2006-11-15 11:41:24,687 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] resolving name: dpsDriverCriteria
              2006-11-15 11:41:24,687 DEBUG [org.jboss.seam.Component] seam component not found: dpsDriverCriteria
              2006-11-15 11:41:24,687 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] could not resolve name
              2006-11-15 11:41:24,687 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] resolving name: dpsDriversFound
              2006-11-15 11:41:24,687 DEBUG [org.jboss.seam.Component] seam component not found: dpsDriversFound
              2006-11-15 11:41:24,687 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] could not resolve name
              2006-11-15 11:41:24,687 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] resolving name: dpsDriversFound
              2006-11-15 11:41:24,687 DEBUG [org.jboss.seam.Component] seam component not found: dpsDriversFound
              2006-11-15 11:41:24,687 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] could not resolve name
              2006-11-15 11:41:24,687 DEBUG [org.jboss.seam.util.Naming] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}
              2006-11-15 11:41:24,687 DEBUG [org.jboss.seam.jsf.SeamExtendedManagedPersistencePhaseListener] committing transaction after phase: PROCESS_VALIDATIONS(3)
              2006-11-15 11:41:24,687 DEBUG [org.jboss.seam.util.Naming] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}
              2006-11-15 11:41:24,687 DEBUG [org.jboss.seam.util.Naming] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}
              2006-11-15 11:41:24,687 DEBUG [org.jboss.seam.jsf.SeamExtendedManagedPersistencePhaseListener] beginning transaction prior to phase: RENDER_RESPONSE(6)
              2006-11-15 11:41:24,687 DEBUG [org.jboss.seam.util.Naming] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}
              2006-11-15 11:41:24,687 DEBUG [org.jboss.seam.Component] instantiating Seam component: facesMessages
              2006-11-15 11:41:24,718 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] resolving name: dpsDriversFound
              2006-11-15 11:41:24,718 DEBUG [org.jboss.seam.Component] seam component not found: dpsDriversFound
              2006-11-15 11:41:24,718 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] could not resolve name
              2006-11-15 11:41:24,718 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] resolving name: dpsDriversFound
              2006-11-15 11:41:24,718 DEBUG [org.jboss.seam.Component] seam component not found: dpsDriversFound
              2006-11-15 11:41:24,718 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] could not resolve name
              2006-11-15 11:41:24,718 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] resolving name: dpsDriversFound
              2006-11-15 11:41:24,718 DEBUG [org.jboss.seam.Component] seam component not found: dpsDriversFound
              2006-11-15 11:41:24,718 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] could not resolve name
              2006-11-15 11:41:24,718 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] resolving name: dpsDriversFound
              2006-11-15 11:41:24,718 DEBUG [org.jboss.seam.Component] seam component not found: dpsDriversFound
              2006-11-15 11:41:24,718 DEBUG [org.jboss.seam.jsf.SeamVariableResolver] could not resolve name
              2006-11-15 11:41:24,718 DEBUG [org.jboss.seam.core.Manager] Discarding conversation state: 3
              2006-11-15 11:41:24,718 DEBUG [org.jboss.seam.contexts.Lifecycle] flushing page context
              2006-11-15 11:41:24,734 DEBUG [org.jboss.seam.util.Naming] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}
              2006-11-15 11:41:24,734 DEBUG [org.jboss.seam.jsf.SeamExtendedManagedPersistencePhaseListener] committing transaction after phase: RENDER_RESPONSE(6)
              2006-11-15 11:41:24,734 DEBUG [org.jboss.seam.util.Naming] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}
              2006-11-15 11:41:24,734 DEBUG [org.jboss.seam.contexts.Lifecycle] After render response, destroying contexts
              2006-11-15 11:41:24,734 DEBUG [org.jboss.seam.contexts.Lifecycle] destroying event context
              2006-11-15 11:41:24,734 DEBUG [org.jboss.seam.contexts.Contexts] destroying: org.jboss.seam.core.manager
              2006-11-15 11:41:24,734 DEBUG [org.jboss.seam.contexts.Contexts] destroying: org.apache.myfaces.application.jsp.JspStateManagerImpl.SERIALIZED_VIEW
              2006-11-15 11:41:24,734 DEBUG [org.jboss.seam.contexts.Contexts] destroying: com.sun.facelets.legacy.ELCONTEXT
              2006-11-15 11:41:24,734 DEBUG [org.jboss.seam.contexts.Lifecycle] destroying conversation context
              2006-11-15 11:41:24,734 DEBUG [org.jboss.seam.contexts.Contexts] destroying: facesMessages
              2006-11-15 11:41:24,734 DEBUG [org.jboss.seam.contexts.Lifecycle] flushing server-side conversation context
              2006-11-15 11:41:24,734 DEBUG [org.jboss.seam.contexts.Lifecycle] <<< End web request
              2006-11-15 11:41:24,734 DEBUG [org.jboss.seam.util.Naming] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}
              


              In regards to the @Factory, page 13, item 5, states that the Factory method
              tells the system to call this method upon first invocation to preload data.
              There is nothing to preload until the user has entered a search criteria. The
              first time in, yea, there wouldn't be a variable created. But the second time
              in it should create and populate the dpsDriverCriteria property, but again,
              it treats that as a component, not a property of the DpsDriversList object.

              and again, following the examples in the book, shouldn't

              <h:commandButton styleClass="formButton" action="#{dpsDriversList.findDpsDrivers}" value="Search"/>

              invoke the method dpsDriversList.findDpsDrivers() ?!



              • 4. Re: more seam resolver issues - how to handle a list that is
                Gavin King Master

                Sorry, but I'm not going to write your code for you. There is *nothing* here that the example applications are not doing, so please follow the examples.