hi to all,
i m new to struts2,jpa and i retrieved the data from database so please help me to show the data on jsp page.
my action class is:-


 package com.action;    
 
     import java.util.Iterator;    
     import java.util.List;    
 
     import javax.persistence.EntityManager;    
     import javax.persistence.EntityManagerFactory;    
     import javax.persistence.EntityTransaction;    
     import javax.persistence.Persistence;    
    import javax.persistence.Query;    
 
    import org.apache.struts2.convention.annotation.*;    
    import org.apache.struts2.rest.DefaultHttpHeaders;    
 
    import com.opensymphony.xwork2.ActionSupport;    
 
    @ParentPackage(value="default")    
    @Namespace("/")    
    @ResultPath(value="/")    
 
    public class noOfUsers extends ActionSupport {    
 
        private static final long serialVersionUID = 1L;    
 
    @Action(value="usersn",results={    
        @Result(name="create",type="tiles",location="users")        
        })    
 
        public static DefaultHttpHeaders create(){    
 
            EntityManagerFactory emf=Persistence.createEntityManagerFactory("tujpa");    
            EntityManager em=emf.createEntityManager();    
            EntityTransaction entr=em.getTransaction();    
            entr.begin();           
            Query  query=em.createQuery("SELECT U.firstname from User U");    
            List <User> list = query.getResultList();    
            System.out.println("password");    
            Iterator iterator = list.iterator();    
            System.out.println("password1");    
 
            while(iterator.hasNext()){    
                String empFirstName = (String)iterator.next();      
                System.out.print("Emp Name:"+empFirstName );        
                System.out.println("password2");    
            }    
                  entr.commit();    
                  em.close();    
            return new DefaultHttpHeaders("create");        
        }    
    }