[jboss-user] [JBoss Seam] - Problem starting converstaion and setting state from HTTP GE

c_eric_ray do-not-reply at jboss.com
Wed Jul 19 20:31:35 EDT 2006


I have a simple page using the standard login form using j_security_check. JBoss is configured to authenticate against an LDAP server. Once authenticated the <welcome-page> is rendered and it simply does this...
<meta http-equiv="Refresh" content="0; URL=extract/index.jsf">
When index.jsf is rendered I need some data retrieved from the database so I can display it immeditately. That's where I have a problem. I can't get the data loaded from the database and displayed in my page.

I've tried all recommendations in Section 3.3 of the SEAM documentation. Nothing works. I'm sure I'm doing something wrong. Any ideas.

Here's the code...

  | @Stateful
  | @Name("package")
  | public class PackageAction implements Package {
  | 
  |   @DataModel
  |   private List<PackageEntity> packages = null;
  |   
  |   @PersistenceContext(unitName="DC")
  |   private EntityManager em;
  |   
  |   
  |   public PackageAction() {}
  |   
  |   @Begin(join=true) @Create
  |   public void load() {
  |     packages = em.createQuery("from PackageEntity").getResultList();
  |   }
  |   
  |   @Destroy @Remove
  |   public void destroy() {}
  | }
  | 
I even added a pages.xml file like so...

  | <pages>
  |     <page view-id="/extract/index.jsf" action="#{package.load}"/>
  | </pages>
  | 
and that doesn't work either.

Here's the web page...

  | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  | <f:view xmlns:h="http://java.sun.com/jsf/html"
  |   xmlns:f="http://java.sun.com/jsf/core"
  |   xmlns:c="http://java.sun.com/jstl/core"
  |   xmlns:ui="http://java.sun.com/jsf/facelets">
  | 
  |   <ui:composition>
  |     <f:loadBundle basename="bundle.packageTable" var="pkgHeaders" />
  | 
  |     <h:form>
  |       <h:dataTable value="#{packages}" var="pkgEntity" styleClass="dataTableBody" headerClass="dataTableHeader" 
  |       rowClasses="evenRow,oddRow" cellspacing="0">
  |         <h:column>
  |           <f:facet name="header">
  |             <h:outputText value="#{pkgHeaders.id}" />
  |           </f:facet>
  |           <h:outputText value="#{pkgEntity.id}" />
  |         </h:column>
  |         <h:column>
  |           <f:facet name="header">
  |             <h:outputText value="#{pkgHeaders.status}" />
  |           </f:facet>
  |           <h:outputText value="#{pkgEntity.statusCode}" />
  |         </h:column>
  |         <h:column>
  |           <f:facet name="header">
  |             <h:outputText value="#{pkgHeaders.user}" />
  |           </f:facet>
  |           <h:outputText value="#{pkgEntity.user.username}" />
  |         </h:column>
  | 
  |          ...  
  | 
  |       </h:dataTable>
  |     </h:form>
  |   </ui:composition>
  | </f:view>
  | 

Thanks.
Eric Ray

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3959386#3959386

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3959386



More information about the jboss-user mailing list