2 Replies Latest reply on Apr 13, 2009 3:48 AM by zwz mycoy

    HELP passing parameters between pages

    zwz mycoy Newbie

      Hi, everyone:
         I'm trying to pass parameters between page. For example, i pass an id from home.jsp to a seam component in which i do some DB query according the parameter and then redirect to another page.  But i cannot get the queried result.

         the start page:

         <h:form prependId="false">
             <h:inputText id="id" value="#{testId}"></h:inputText>
             <h:commandLink action="#{test_statefull.turn}">
                 <h:outputText value="CommandLink"></h:outputText>

          the seam component:

      public class TestAction_Stateful implements TestStatefull{
           @PersistenceContext(type = EXTENDED)
           private EntityManager em;
           private List testList; //=new LinkedList();     
           private String testId;
           public String turn(){
                System.out.println("%%%%%%%%%%%%%%%%  "+testId);
                testList=new LinkedList();
                else if(testId.equals("2")){
                return "turn";
           public void destroy(){

          the result page:

              <h:dataTable border="0" value="#{testList}" var="ll">
                <h:column id="column1">
                     <h:outputText value="#{ll}"></h:outputText>

          in the result page, i always get nothing.
          I have tried add a factory method into the seam component:

      public void find(){          
           System.out.println("%%%%%%%%%%%%%%%%  "+testId);
           System.out.println("%%%%%%%%%%%%%%%%  "+testList);

          But both the testId and testList are null.
          I have also tried seam-pojo and stateless-session-bean as the component and tried default scope, but all failed.
          Could anyone help me? Thanks a lot.