1 Reply Latest reply on Jun 30, 2010 6:14 PM by Arbi Sookazian

    Seam not outjecting to session after redirect

    Zarar Siddiqi Newbie
      In my Seam component I have the following outject happening:

      @Out(required=false, ScopeType.SESSION)
      private SearchResults searchResults;


      and in the method that's being called by the <h:commandLink/>, I have:

      public void doSearch() {
         searchResults = ...
         return "external";
      }

      In pages.xml, I have:

              <navigation from-action="#{searchAction.doSearch}">
                  <rule if-outcome="external">
                      <redirect url="http://www.someurl.com"/>
                  </rule>
               </navigation>


      Once the redirect happens and the user eventually returns to my site, the searchResults object is not stored in session scope.  I even tried putting it in manually using:

      Contexts.getSessionContext().set("searchResults", searchResults);

      but even that doesn't work.

      What am I missing?
        • 1. Re: Seam not outjecting to session after redirect
          Arbi Sookazian Master

          1) void methods cannot return a value.
          2) have you tried it without the navigation XML snippet in pages.xml?


          Try something like this:


          <navigation-rule>
             <from-view-id>/foo.xhtml</from-view-id>
             <navigation-case>
               <from-action>#{searchAction.doSearch}</from-action>
               <from-outcome>external</from-outcome>
               <to-view-id>/welcome.xhtml</to-view-id>
               <redirect/>
             </navigation-case>
          </navigation-rule>



          to determine if it's the URL you're redirecting to that's the root cause...